qiuchenjian opened a new pull request #3135: [CARBONDATA-3303] Fix that MV datamap return wrong results when using coalesce and less groupby columns
URL:
https://github.com/apache/carbondata/pull/3135
### Problem
MV datamap return wrong results when using coalesce and query SQL's groupby columns is less than MV SQL's
`create table coalesce_test_main(id int,name string,height int,weight int using carbondata`
`insert into coalesce_test_main select 1,'tom',170,130`
`insert into coalesce_test_main select 2,'tom',170,120`
`insert into coalesce_test_main select 3,'lily',160,100`
`create datamap coalesce_test_main_mv using 'mv' as select coalesce(sum(id),0) as sum_id,name as myname,weight from coalesce_test_main group by name,weight`
`select coalesce(sum(id),0) as sumid,name from coalesce_test_main group by name`
The query results:
`1 tom`
`2 tom`
`3 lily`
### Solution
When query SQL's groupby columns is less than MV SQL's and the MV SQL has coalesce expression, MV table cann't calculate the right result, so MV shouldn't take effect at this scene
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
Add new testcase
- [ ] 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:
[hidden email]
With regards,
Apache Git Services