xiangfu0 commented on code in PR #19991:
URL: https://github.com/apache/pinot/pull/19991#discussion_r4381396313
##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/AggregationFunctionType.java:
##########
@@ -428,6 +428,15 @@ public static AggregationFunctionType
getAggregationFunctionType(String function
}
}
+ /// Returns DOUBLE, or the type of the data argument for the explicit data
type form MODE(expr, reducer, dataType).
+ private static class ModeFinalReturnTypeInference implements
SqlReturnTypeInference {
+ @Override
+ public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
+ return opBinding.getOperandCount() == 3 ?
ReturnTypes.ARG0.inferReturnType(opBinding)
+ : opBinding.getTypeFactory().createSqlType(SqlTypeName.DOUBLE);
+ }
Review Comment:
Added a line to the doc comment: only a leaf stage that returns final
results uses this inference, and the query's result type comes from Calcite's
MODE (ARG0). In 269a7ebdc4.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]