You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/17 12:05:40 UTC

[GitHub] qiuchenjian opened a new pull request #3080: [CARBONDATA-3256] Fix that MV datamap doesn't affect using avg expression and count expression

qiuchenjian opened a new pull request #3080: [CARBONDATA-3256] Fix that MV datamap doesn't affect using avg expression and count expression
URL: https://github.com/apache/carbondata/pull/3080
 
 
   [Problem] MV datamap doesn't affect in this test case:
   ```
   create table test_table(name string, age int, height int,weight int) stored by 'carbondata'
   create datamap test_table_mv using 'mv' as select sum(height),count(age),avg(age),name from test_table group by name
   explain select avg(age),name from test_table group by name
   ```
   QueryPlan:
   ```
   *HashAggregate(keys=name#33, functions=count(age#34), avg(cast(age#34 as bigint)))
   +- Exchange hashpartitioning(name#33, 200)
   +- *HashAggregate(keys=name#33, functions=partial_count(age#34), partial_avg(cast(age#34 as bigint)))
   +- *FileScan carbondata default.test_tablename#33,age#34]      
   ``` 
   
   [Solution] Fix this bug
   QueryPlan:
   ```
   *HashAggregate(keys=[name#282], functions=[sum(count(age)#280L), sum((avg(age)#281 * cast(count(age)#280L as double))), sum(count(age)#280L)])
   +- Exchange hashpartitioning(name#282, 200)
      +- *HashAggregate(keys=[name#282], functions=[partial_sum(count(age)#280L), partial_sum((avg(age)#281 * cast(count(age)#280L as double))), partial_sum(count(age)#280L)])
         +- *Project [count_age#168L AS count(age)#280L, avg_age#169 AS avg(age)#281, test_table_name#170 AS name#282]
            +- *FileScan carbondata default.test_table_mv_table[count_age#168L,avg_age#169,test_table_name#170]]
   ```
   
   Be sure to do all of the following checklist to help us incorporate 
   your contribution quickly and easily:
   
    - [ ] Any interfaces changed?
    
    - [ ] Any backward compatibility impacted?
    
    - [ ] Document update required?
   
    - [ ] Testing done
   
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services