rubenada commented on a change in pull request #2194:
URL: https://github.com/apache/calcite/pull/2194#discussion_r501518483
##########
File path: core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java
##########
@@ -872,23 +872,36 @@ public static boolean
checkInputForCollationAndLimit(RelMetadataQuery mq,
RelNode input, RelCollation collation, RexNode offset, RexNode fetch) {
// Check if the input is already sorted
boolean alreadySorted = collation.getFieldCollations().isEmpty();
- for (RelCollation inputCollation : mq.collations(input)) {
- if (inputCollation.satisfies(collation)) {
- alreadySorted = true;
- break;
+ if (!alreadySorted) {
+ final ImmutableList<RelCollation> collations = mq.collations(input);
+ if (collations != null) {
Review comment:
Changed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]