rdblue commented on code in PR #6923:
URL: https://github.com/apache/iceberg/pull/6923#discussion_r1117824744


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkAggregates.java:
##########
@@ -48,31 +48,20 @@ public static Expression convert(AggregateFunc aggregate) {
         case COUNT:
           Count countAgg = (Count) aggregate;
           if (countAgg.isDistinct()) {
-            // manifest file doesn't have count distinct so this can't be 
converted to push down
-            return null;
-          }
-
-          if (countAgg.column() instanceof NamedReference) {
-            return Expressions.count(SparkUtil.toColumnName((NamedReference) 
countAgg.column()));
-          } else {
             return null;
           }
+          assert (countAgg.column() instanceof NamedReference);

Review Comment:
   We don't usually include assertions. Can you update this to an `if` check 
that causes the method to return null?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to