Akshat-Jain commented on code in PR #16682:
URL: https://github.com/apache/druid/pull/16682#discussion_r1668576601
##########
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(),
Review Comment:
Sample error message: `Using aggregator [HLLSketchMerge] is not supported
for complex columns with type [COMPLEX<json>].`
In the native query, values like HLLSketchMerge appear under `aggregations
-> type` nesting, so it should be aggregation type? I'll rename it to
aggregator as suggested though.
```json
"aggregations": [
{
"type": "HLLSketchMerge",
"name": "a0",
"fieldName": "shipTo",
"lgK": 12,
"tgtHllType": "HLL_4",
"round": true
}
```
Thoughts?
--
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]