You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/02/07 06:59:57 UTC

[GitHub] [ignite] zstan commented on a change in pull request #9800: IGNITE-16414 Fix sorted index spool and sorted aggregate collation planning

zstan commented on a change in pull request #9800:
URL: https://github.com/apache/ignite/pull/9800#discussion_r800360380



##########
File path: modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/agg/IgniteSortAggregateBase.java
##########
@@ -48,7 +47,22 @@
     @Override default Pair<RelTraitSet, List<RelTraitSet>> passThroughCollation(
         RelTraitSet nodeTraits, List<RelTraitSet> inputTraits
     ) {
-        RelCollation collation = RelCollations.of(ImmutableIntList.copyOf(getGroupSet().asList()));
+        RelCollation required = TraitUtils.collation(nodeTraits);
+        ImmutableBitSet requiredKeys = ImmutableBitSet.of(required.getKeys());
+        RelCollation collation;
+
+        if (getGroupSet().contains(requiredKeys)) {

Review comment:
       ```suggestion
           if (getGroupSet().contains(requiredKeys)) {
               ImmutableBitSet keysLeft = getGroupSet().except(requiredKeys);
               
               List<RelFieldCollation> newCollationFields = 
                   new ArrayList<>(required.getFieldCollations().size() + keysLeft.size());
               
               newCollationFields.addAll(required.getFieldCollations());
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org