Akshat-Jain commented on code in PR #16682:
URL: https://github.com/apache/druid/pull/16682#discussion_r1668586504


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:
##########
@@ -180,6 +190,11 @@ public Aggregation toDruidAggregation(
       }
     }
 
+    if (aggregatorFactory == null) {
+      plannerContext.setPlanningError("Using APPROX_COUNT_DISTINCT() or 
enabling approximation with COUNT(DISTINCT) is not supported for %s column. You 
can disable approximation and use COUNT(DISTINCT %s) and run the query again.", 
columnArg.getDruidType(), columnArg.getSimpleExtraction().getColumn());

Review Comment:
   > Please format it according to the dev guide.
   I've trimmed down the line lengths. Is there a way to make Intellij apply 
the formatting xml? I have it imported but it doesn't seem to take care of 
these things.
   
   > columnArg.getSimpleExtraction().getColumn() might not be a one to one 
mapping to the column name that you are expecting. It can also throw an NPE.
   
   Can you elaborate? Under what scenario can it give NPE? Also, what's the 
safer alternative to use 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.

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