oleg-zinovev commented on code in PR #12096:
URL: https://github.com/apache/ignite/pull/12096#discussion_r3303757917


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/WindowPlannerTest.java:
##########
@@ -203,4 +206,39 @@ public void testWindowCollationAndIncompatibleTableIndex() 
throws Exception {
         assertPlan(sql, publicSchema, 
nodeOrAnyChild(isInstanceOf(IgniteWindow.class)
             .and(input(not(isIndexScan("INDEXED_TBL", "INDEXED_TBL_IDX"))))));
     }
+
+    /**
+     * @throws Exception if failed
+     */
+    @Test
+    public void testPassThroughCollationWiderThanInputRow() throws Exception {
+        String sql = "SELECT ID, row_number() OVER (ORDER BY ID) FROM 
RANDOM_TBL ORDER BY 1, 2";
+
+        RelCollation sortCollation = RelCollations.of(
+            TraitUtils.createFieldCollation(0, true),
+            TraitUtils.createFieldCollation(1, true)
+        );
+
+        RelCollation derivedCollation = RelCollations.of(
+            TraitUtils.createFieldCollation(0, true)
+        );
+
+        assertPlan(sql, publicSchema, 
nodeOrAnyChild(isInstanceOf(IgniteSort.class)
+            .and(it -> it.collation().equals(sortCollation))
+            .and(input(isInstanceOf(IgniteWindow.class)

Review Comment:
   @alex-plekhanov 
   Hi,
   Could you explain why this check is needed? If `IgniteWindow` does not 
contain the sort below, then the enforced `IgniteSort` will be created by 
`org.apache.ignite.internal.processors.query.calcite.rel.IgniteConvention#enforce.`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to