LakshSingla commented on code in PR #16682:
URL: https://github.com/apache/druid/pull/16682#discussion_r1668572609
##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregatorFactory.java:
##########
@@ -142,6 +151,22 @@ public VectorAggregator
factorizeVector(VectorColumnSelectorFactory selectorFact
);
}
+ private void validateInputs(@Nullable ColumnCapabilities capabilities)
+ {
+ if (capabilities != null) {
+ final ColumnType type = capabilities.toColumnType();
+ if (!ColumnType.UNKNOWN_COMPLEX.equals(type) && !TYPE.equals(type) &&
+ !(ValueType.COMPLEX.equals(type.getType()) &&
+ (Objects.equals(type.getComplexTypeName(), "HLLSketch") ||
+ Objects.equals(type.getComplexTypeName(), "HLLSketchBuild")))) {
+ throw new UOE("Using aggregation type %s is not supported for %s
column. "
+ + "Use a different aggregator type and run the query
again.",
+ getIntermediateType().getComplexTypeName(),
+ type);
Review Comment:
Its like:
```java
throw new UOE(a,
b);
```
Correct would be something like:
```suggestion
throw new UOE(
"Using aggregation type %s is not supported for %s column. "
+ "Use a different aggregator type and run the query
again.",
getIntermediateType().getComplexTypeName(),
type
);
```
The code style doesn't catch such errors afair.
--
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]