IGNITE-27976 Support OVER clause with unbounded frame#12815
IGNITE-27976 Support OVER clause with unbounded frame#12815vldpyatkov wants to merge 7 commits intoapache:masterfrom
Conversation
b002ed7 to
ea9dda3
Compare
...he/ignite/internal/processors/query/calcite/rule/logical/IgniteLogicalWindowRewriteRule.java
Outdated
Show resolved
Hide resolved
...he/ignite/internal/processors/query/calcite/rule/logical/IgniteLogicalWindowRewriteRule.java
Show resolved
Hide resolved
| */ | ||
| private static List<RexNode> buildProjection(RelNode join, LogicalWindow win, LogicalWindow.Group grp) { | ||
| RexBuilder rexBuilder = win.getCluster().getRexBuilder(); | ||
| int inputFieldCnt = win.getInput().getRowType().getFieldCount(); |
There was a problem hiding this comment.
no one test is covered case where inputFieldCnt != 0, it need to be covered or removed if unnecessary
There was a problem hiding this comment.
inputFieldCnt - count of fields in the input projection, before a window group calculation.
grpKeyCnt - count of fields into "PARTITION BY" clause.
aggFieldCnt - count of aggregate functions in the windows group.
These vars are not 0 in almost all queries.
...he/ignite/internal/processors/query/calcite/rule/logical/IgniteLogicalWindowRewriteRule.java
Outdated
Show resolved
Hide resolved
...he/ignite/internal/processors/query/calcite/rule/logical/IgniteLogicalWindowRewriteRule.java
Outdated
Show resolved
Hide resolved
| RexNode left = rexBuilder.makeInputRef(joinRowType, keyIdx); | ||
| RexNode right = rexBuilder.makeInputRef(joinRowType, inputFieldCnt + i); |
There was a problem hiding this comment.
| RexNode left = rexBuilder.makeInputRef(joinRowType, keyIdx); | |
| RexNode right = rexBuilder.makeInputRef(joinRowType, inputFieldCnt + i); | |
| RexNode left = rexBuilder.makeInputRef(input.getRowType(), keyIdx); | |
| RexNode right = rexBuilder.makeInputRef(agg.getRowType(), inputFieldCnt + i); |
There was a problem hiding this comment.
I doubt the type calculation, but nothing failed when I did it like you said.
So, finally, this change applied.
|
Overall looks good, one case is questionable - what the plan for supporting "ORDER BY" ? Did this rule still be helpful or it need to be ovewritten at all ? @alex-plekhanov plz take a look too ? |
Unfortunately, the "ORDER BY" clause is far from the entire implementation of window functions. |
|




https://issues.apache.org/jira/browse/IGNITE-27976