kgyrtkirk commented on code in PR #16682:
URL: https://github.com/apache/druid/pull/16682#discussion_r1681043418


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchBaseSqlAggregator.java:
##########
@@ -154,6 +155,15 @@ public Aggregation toDruidAggregation(
       }
 
       if (inputType.is(ValueType.COMPLEX)) {
+        if (!isValidComplexInputType(inputType)) {
+          plannerContext.setPlanningError(
+              "Using APPROX_COUNT_DISTINCT() or enabling approximation with 
COUNT(DISTINCT) is not supported for"
+              + " column type [%s]. You can disable approximation, use 
COUNT(DISTINCT %s) and rerun the query.",
+              columnArg.getDruidType(),
+              columnArg.getSimpleExtraction().getColumn()

Review Comment:
   there is no gurantee that `columnArg.getSimpleExtraction()` is not null; you 
could just omit it from the message
   
   ...and it would be helpfull for the user meeting with this error to have 
`PlannerConfig.CTX_KEY_USE_APPROXIMATE_COUNT_DISTINCT` suggested to be enabled



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