[ 
https://issues.apache.org/jira/browse/CARBONDATA-2523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524449#comment-16524449
 ] 

xubo245 commented on CARBONDATA-2523:
-------------------------------------

It's work fine in cluster:


{code:java}
0: jdbc:hive2://hadoop1:10000>  rebuild datamap mv13;
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (2.077 seconds)
0: jdbc:hive2://hadoop1:10000> explain select name,sum(salary) from test4 group 
by name;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
|                                                                               
                                                                                
                                                                                
    plan                                                                        
                                                                                
                                                                                
            |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
| == CarbonData Profiler ==
Table Scan on mv13_table
 - total blocklets: 1
 - filter: none
 - pruned by Main DataMap
    - skipped blocklets: 0
                                                                                
                                                                                
                                                                                
                                                                                
                            |
| == Physical Plan ==
*HashAggregate(keys=[test4_name#295], functions=[sum(sum_salary#296L)])
+- Exchange hashpartitioning(test4_name#295, 200)
   +- *HashAggregate(keys=[test4_name#295], 
functions=[partial_sum(sum_salary#296L)])
      +- *BatchedScan CarbonDatasourceHadoopRelation [ Database name :default, 
Table name :mv13_table, Schema 
:Some(StructType(StructField(test4_name,StringType,true), 
StructField(sum_salary,LongType,true))) ] 
default.mv13_table[test4_name#295,sum_salary#296L]  |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--+
2 rows selected (0.267 seconds)
0: jdbc:hive2://hadoop1:10000>

{code}


> MV DataMap not working for Aggregate Queries
> --------------------------------------------
>
>                 Key: CARBONDATA-2523
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2523
>             Project: CarbonData
>          Issue Type: Bug
>            Reporter: Babulal
>            Assignee: xubo245
>            Priority: Major
>
> 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.test4[name#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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to