calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-3352] ProjectToWindowRule sets wrong collation on generated Window

Open pavelgubin opened this issue 5 years ago • 3 comments

pavelgubin avatar Sep 17 '19 12:09 pavelgubin

BTW, I think the plan in the test case is wrong.

hsyuan avatar Sep 20 '19 02:09 hsyuan

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.

jinxing64 avatar Sep 23 '19 07:09 jinxing64

Can you rebase on latest master and adopt @jinxing64 's suggestion?

hsyuan avatar Oct 21 '19 21:10 hsyuan