wojustme commented on a change in pull request #2702:
URL: https://github.com/apache/calcite/pull/2702#discussion_r811646787



##########
File path: core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
##########
@@ -1671,6 +1677,104 @@ private IntersectOnCalcsToIntersectUnifyRule() {
     }
   }
 
+  /**
+   * A {@link SubstitutionVisitor.UnifyRule} that matches a
+   * {@link MutableSort} to a {@link MutableSort} where the query and target
+   * have the same inputs but might not have the same order.
+   */
+  private static class SortToSortUnifyRule extends AbstractUnifyRule {
+
+    public static final SortToSortUnifyRule INSTANCE = new 
SortToSortUnifyRule();
+
+    private SortToSortUnifyRule() {
+      super(any(MutableSort.class), any(MutableSort.class), 0);
+    }
+
+    @Override protected @Nullable UnifyResult apply(UnifyRuleCall call) {
+      final MutableSort query = (MutableSort) call.query;
+      final MutableSort target = (MutableSort) call.target;
+      final RelCollation queryCollation = query.collation;
+      final RelCollation targetCollation = target.collation;

Review comment:
       OK, Got it.




-- 
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