Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-3403

MV is not working for like and filter AND and OR queries

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: None
    • Labels:
      None

      Description

      MV is not working for like and filter AND and OR queries

       

      Steps:

      create table brinjal (imei string,AMSize string,channelsId string,ActiveCountry string, Activecity string,gamePointId double,deviceInformationId double,productionDate Timestamp,deliveryDate timestamp,deliverycharge double) STORED BY 'org.apache.carbondata.format' ;

       

      create datamap brinjal_mv_tab_nlz_aa016 on table brinjal using 'mv' as select imei,AMSize,channelsId from brinjal where ActiveCountry NOT LIKE 'US' group by imei,AMSize,channelsId;

      create datamap brinjal_mv_tab_nlz_aa018 on table brinjal using 'mv' as select imei,AMSize,channelsId,ActiveCountry from brinjal where ActiveCountry ='Chinese' or channelsId =4 group by imei,AMSize,channelsId,ActiveCountry;

       

      then 

      select imei,AMSize,channelsId from brinjal where ActiveCountry NOT LIKE 'US' group by imei,AMSize,channelsId; and 

        select imei,AMSize,channelsId,ActiveCountry from brinjal where ActiveCountry ='Chinese' or channelsId =4 group by imei,AMSize,channelsId,ActiveCountry;

      are not hitting the datamap cretaed

      def updatePlan(plan: ModularPlan): ModularPlan = {
      // get all the outputlist from relation
      val dmOutputList = plan.collect

      { case s@modular.Select(_, _, _, _, _, children, _, _, _, _) if children .forall(_.isInstanceOf[modular.LeafNode]) => s.outputList }

      .flatten
      val newPlan = plan.transform {
      case plan =>
      plan.transformExpressions {
      case attr: Attribute =>
      val existingCol = dmOutputList.find(_.exprId.equals(attr.exprId))
      if (existingCol.isDefined)

      { AttributeReference(existingCol.get.name, attr.dataType)(exprId = attr.exprId, qualifier = attr.qualifier) }

      else

      { attr }

      }
      }
      newPlan
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                akashrn5 Akash R Nilugal
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m