lowka commented on code in PR #2461:
URL: https://github.com/apache/ignite-3/pull/2461#discussion_r1307326212


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/rel/agg/IgniteSortAggregateBase.java:
##########
@@ -44,7 +44,34 @@ interface IgniteSortAggregateBase extends 
TraitsAwareIgniteRel {
      */
     ImmutableBitSet getGroupSet();
 
-    /** {@inheritDoc} */
+    /**
+     * Performs propagation of {@link RelCollation collation trait}.
+     *
+     * <p>Sorted aggregate operate on already sorted input to perform 
aggregation/grouping.
+     * Because of that such operator produces rows sorted by grouping columns, 
and it can produce
+     * results that may satisfy required collation trait (ordering).
+     *
+     * <p>If a grouping set contains a subset of ordering columns, then inputs 
should provide
+     * {@code ordering by grouping set columns + ordering by columns that are 
not provided by this operator}:
+     *
+     * <pre>
+     *       GROUP BY a, b, c ORDER BY a, b
+     *       Input collation: (a, b, c)
+     * </pre>
+     *
+     * <p>Otherwise this operator is unable to fully satisfy required ordering 
and we require collation trait based
+     * columns from the grouping set, and the rest of of the requirements is 
going to be satisfied by enforcer operator:
+     * <pre>
+     *     GROUP BY a, b ORDER BY a, b, c
+     *     Input collation (a, b)
+     *     Enforcer: adds ordering by c
+     * </pre>
+     *
+     * @param nodeTraits Required relational node output traits.
+     * @param inputTraits Required relational node input traits.

Review Comment:
   Fixed.



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