julianhyde commented on a change in pull request #1335: [CALCITE-3159] Distinct 
can be removed for MIN/MAX/BIT_OR/BIT_AND agg…
URL: https://github.com/apache/calcite/pull/1335#discussion_r308358616
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java
 ##########
 @@ -98,7 +99,7 @@ private AggregateCall(SqlAggFunction aggFunction, boolean 
distinct,
     this.argList = ImmutableList.copyOf(argList);
     this.filterArg = filterArg;
     this.collation = Objects.requireNonNull(collation);
-    this.distinct = distinct;
+    this.distinct = aggFunction.getDistinctOptionality() != 
Optionality.IGNORED && distinct;
 
 Review comment:
   Worth adding a comment to explain what is going on here.

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


With regards,
Apache Git Services

Reply via email to