[CALCITE-3448] AggregateOnCalcToAggregateUnifyRule ignores Project…#1532
Closed
jinxing64 wants to merge 3 commits intoapache:masterfrom
Closed
[CALCITE-3448] AggregateOnCalcToAggregateUnifyRule ignores Project…#1532jinxing64 wants to merge 3 commits intoapache:masterfrom
jinxing64 wants to merge 3 commits intoapache:masterfrom
Conversation
ab88eb4 to
9dfb1b1
Compare
Contributor
Author
|
cc @DonnyZone |
Contributor
|
Hi @jinxing64, sorry for the late reply! I'm outing these days, and I will take a look tomorrow. |
Contributor
Author
|
Thanks a lot @DonnyZone ~ |
DonnyZone
reviewed
Oct 28, 2019
| return false; | ||
| } | ||
| prevTarget = target; | ||
| if (target != -1) { |
Contributor
There was a problem hiding this comment.
Maybe we can combine two if clause together?
Contributor
|
LGTM! |
Contributor
|
By the way, have you test the below case? |
9dfb1b1 to
a74e963
Compare
Contributor
Author
|
I tested the test case you provided @DonnyZone The result is correct as below: |
Contributor
Author
|
Hi Zhu Feng ~ |
…correctly when there's missing grouping or mapping breaks ordering (Jin Xing)
a74e963 to
c7a3db2
Compare
Contributor
Author
|
Hi ~ committers, |
Contributor
|
Ping @hsyuan |
Member
|
Will do |
hsyuan
reviewed
Nov 5, 2019
core/src/test/java/org/apache/calcite/test/MaterializationTest.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Thanks a lot for approval ~ |
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 17, 2019
…rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532
wangxlong
pushed a commit
to wangxlong/calcite
that referenced
this pull request
Feb 13, 2020
…rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Aug 28, 2025
apache#35) …rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532 Change-Id: I4a8086d0181774e618237374d73e6a5b062f3b37 Co-authored-by: jinxing <jinxing.corey@gmail.com>
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Mar 16, 2026
apache#35) …rectly (Jin Xing) CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target. Below matching fails: MV: select empid, deptno, name, count(*) from emps group by empid, deptno, name Query: select name, empid, count(*) from emps group by name, empid Note that -- comparing groupings in MV (empid, deptno, name) and groupings in query (name, empid), deptno is missed and ordering is broken Close apache#1532 Change-Id: I4a8086d0181774e618237374d73e6a5b062f3b37 Co-authored-by: jinxing <jinxing.corey@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… incorrectly when there's missing grouping or mapping breaks ordering (Jin Xing)
CALCITE-3087 fixed AggregateOnProjectToAggregateUnifyRule when mapping under Aggregate breaks ordering. But it fails when there's missing grouping in query compared with target.
Below matching fails:
Note that -- comparing groupings in MV
(empid, deptno, name)and groupings in query(name, empid),deptnois missed and ordering is broken