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

MV DataMap not working for Aggregate Queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Spark Release 

      Spark2.2.1 

      Run Below command in sequence 

      0: jdbc:hive2://10.18.222.231:23040> create table test4 ( name string,age int,salary int) stored by 'carbondata';
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (0.331 seconds)
      0: jdbc:hive2://10.18.222.231:23040> insert into test4 select 'babu',12,12;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (14.65 seconds)
      0: jdbc:hive2://10.18.222.231:23040> create datamap mv13 using 'mv' as select name,sum(salary) from test4 group by name;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (0.654 seconds)
      0: jdbc:hive2://10.18.222.231:23040> rebuild datamap mv13;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (17.072 seconds)
      0: jdbc:hive2://10.18.222.231:23040> explain select name,sum(salary) from test4 group by name;
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

      plan

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

      == CarbonData Profiler ==
      Table Scan on test4
      • total blocklets: 1
      • filter: none
      • pruned by Main DataMap
      • skipped blocklets: 0
      == Physical Plan ==
      *HashAggregate(keys=name#888, functions=sum(cast(salary#890 as bigint)))
      +- Exchange hashpartitioning(name#888, 200)
      +- *HashAggregate(keys=name#888, functions=partial_sum(cast(salary#890 as bigint)))
      +- *BatchedScan CarbonDatasourceHadoopRelation [ Database name :default, Table name :test4, Schema :Some(StructType(StructField(name,StringType,true), StructField(age,IntegerType,true), StructField(salary,IntegerType,true))) ] default.test4name#888,salary#890

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      2 rows selected (0.488 seconds)
      0: jdbc:hive2://10.18.222.231:23040>

       

       

      In Relation Table is fact table not MV DataMap it suppose to be test4_table.

      Attachments

        Issue Links

          Activity

            People

              xubo245 Bo Xu
              Bjangir Babulal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: