lowka commented on code in PR #2461:
URL: https://github.com/apache/ignite-3/pull/2461#discussion_r1307325994
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/Commons.java:
##########
@@ -477,7 +477,7 @@ public static <T> Predicate<T> negate(Predicate<T> p) {
* @see org.apache.calcite.plan.RelTrait#apply(TargetMapping)
* @see org.apache.calcite.rel.core.AggregateCall#transform(TargetMapping)
*/
- public static Mappings.TargetMapping trimmingMapping(int sourceSize,
ImmutableBitSet requiredElements) {
+ public static Mapping trimmingMapping(int sourceSize, ImmutableBitSet
requiredElements) {
Mapping mapping = Mappings.create(MappingType.PARTIAL_FUNCTION,
sourceSize, requiredElements.cardinality());
Review Comment:
Done.
##########
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:
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]