havefunatcode commented on code in PR #20782:
URL: https://github.com/apache/druid/pull/20782#discussion_r4439634903
##########
sql/src/main/java/org/apache/druid/sql/calcite/expression/OperatorConversions.java:
##########
@@ -594,6 +605,13 @@ protected SqlOperandTypeInference
buildOperandTypeInference()
final IntSet nullableOperands = requiredOperandCount == null
? new IntArraySet()
:
DefaultOperandTypeChecker.buildNullableOperands(requiredOperandCount,
operandTypes.size(), new IntArraySet());
+ if (operandTypes != null) {
Review Comment:
It can be null when the operator is built with `operandTypeChecker` instead
of `operandTypes`, like GREATEST and LEAST. Without the check,
`CalciteQueryTest.testGreatestLeastTypes` failed with an NPE, so I kept the
check and added a comment explaining why.
Moved the rest into `buildNullableOperands`. It takes the operand types now,
so `DefaultOperandTypeChecker` doesn't need the separate `isNullable()` check
either.
I also added the missing tests for the other aggregators, so they all use
the same inputs now (numeric strings, `__time`, and BOOLEAN/ARRAY/complex for
DS_QUANTILES_SKETCH and TDIGEST_GENERATE_SKETCH).
--
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]