havefunatcode commented on code in PR #20782:
URL: https://github.com/apache/druid/pull/20782#discussion_r4435915330
##########
extensions-contrib/tdigestsketch/src/main/java/org/apache/druid/query/aggregation/tdigestsketch/sql/TDigestGenerateSketchSqlAggregator.java:
##########
@@ -154,7 +154,9 @@ private static class TDigestGenerateSketchSqlAggFunction
extends SqlAggFunction
DefaultOperandTypeChecker
.builder()
.operandNames("column", "compression")
- .operandTypes(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC)
+ .operandTypes(SqlTypeFamily.NUMERIC, SqlTypeFamily.NUMERIC)
+ .operandComplexTypes(0, TDigestSketchAggregatorFactory.TYPE)
+ .coercibleOperands(0)
Review Comment:
Thanks, that's much easier to read. Done in the latest commit.
Both builders have `operandTypes(OperandType...)` now and the
`SqlTypeFamily` overloads delegate to it.
`operandComplexTypes`/`coercibleOperands` are removed, and `coerceStrings()`
throws for non-NUMERIC families.
I made it a top-level class in the same package, to match
`OperandType.numeric()` in your call site example. One side effect of the
second varargs overload is that `operandTypes()` with no arguments no longer
compiles, so `AssertionErrorOperatorConversion` passes `new SqlTypeFamily[0]`
instead.
--
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]