PaulJackson123 commented on code in PR #3495:
URL: https://github.com/apache/calcite/pull/3495#discussion_r1405472276
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java:
##########
@@ -378,12 +402,36 @@ public Boolean areColumnsUnique(Intersect rel,
RelMetadataQuery mq,
return null;
}
+ /**
+ * If an input's unique column value is returned (passed through) by an
aggregation function, then
+ * the result of the function is also unique.
+ *
+ * @param columns the columns to test for uniqueness
+ * @param rel the Aggregate {@link RelNode}
+ * @param inputUniqueKeys the set of unique key sets of the Aggregate input
(child RelNode)
+ *
+ * @return whether the input columns are unique by containing a unique
aggregated column
+ */
+ private boolean columnsContainUniqueAgg(ImmutableBitSet columns, Aggregate
rel,
+ Set<ImmutableBitSet> inputUniqueKeys) {
+ List<AggregateCall> aggCallList = rel.getAggCallList();
+ for (int aggIndex = 0; aggIndex < aggCallList.size(); aggIndex++) {
Review Comment:
I refactored and enhanced this.
--
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]