calcite
calcite copied to clipboard
[CALCITE-3352] ProjectToWindowRule sets wrong collation on generated Window
BTW, I think the plan in the test case is wrong.
If I remove the change of ProjectToWindowRule
, I can pass the collation check https://github.com/apache/calcite/pull/1460/files#diff-2b9a6c719e7c1c69c76dccbbc1654ae8R6157
but fail the collation check for https://github.com/apache/calcite/pull/1460/files#diff-2b9a6c719e7c1c69c76dccbbc1654ae8R6155
That's to say the collation of LogicalWindow
is incorrect.
I think the problem might be here https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java#L249
The collation of LogicalWindow should be derived, but not just the same with the parent node.
Can you rebase on latest master and adopt @jinxing64 's suggestion?