GitHub user ravipesala opened a pull request:
https://github.com/apache/carbondata/pull/2453
[CARBONDATA-2528][MV] Fixed order by in mv and aggregation functions inside
projection expressions are fixed
Problem:
Order by queries and the queries with functions like sum(a)+sum(b) are not
working in MV.
Please check jira for more details.
Solution:
The queries which have projection functions like sum(a)+sum(b) cannot be
incrementally loaded, so introduced a new internal DM property to avoid group
by on the final query. In this way the queries like below
```
select empname,sum(salary)+sum(utilization) as total from fact_table1 group
by empname order by empname DESC
```
the above query will be rewritten as follows.
```
SELECT mv_order_table.`fact_table1_empname` AS `empname`,
mv_order_table.`total`
FROM
(SELECT mv_order_table.`fact_table1_empname`, mv_order_table.`total`
FROM
MV_order_table) MV_order_table
ORDER BY `empname` DESC NULLS LAST
```
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
Please provide details on
- Whether new unit test cases have been added or why no new tests
are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance
test report.
- Any additional information to help reviewers in testing this
change.
- [ ] For large changes, please consider breaking it into sub-tasks under
an umbrella JIRA.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ravipesala/incubator-carbondata mv-2522
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/carbondata/pull/2453.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2453
----
commit 7da36c39c6a2354b8f9e0810c13814cba6b61339
Author: ravipesala <ravi.pesala@...>
Date: 2018-06-14T06:10:07Z
Fixed order by in mv and aggregation functions inside projection
expressions are fixed
----
---