You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/02/02 18:17:28 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #10222: [multistage][bugfix] fix non-grouping agg result issue

walterddr commented on code in PR #10222:
URL: https://github.com/apache/pinot/pull/10222#discussion_r1094908758


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/AggregateOperator.java:
##########
@@ -353,22 +369,22 @@ private static class Accumulator {
     final Object _literal;
     final Map<Key, Object> _results = new HashMap<>();
     final Merger _merger;
+    final DataSchema.ColumnDataType _dataType;
 
     Accumulator(RexExpression.FunctionCall aggCall, Map<String, Function<DataSchema.ColumnDataType, Merger>> merger,
         String functionName, DataSchema inputSchema) {
       // agg function operand should either be a InputRef or a Literal
-      DataSchema.ColumnDataType dataType;
       RexExpression rexExpression = toAggregationFunctionOperand(aggCall);
       if (rexExpression instanceof RexExpression.InputRef) {
         _inputRef = ((RexExpression.InputRef) rexExpression).getIndex();
         _literal = null;
-        dataType = inputSchema.getColumnDataType(_inputRef);
+        _dataType = inputSchema.getColumnDataType(_inputRef);
       } else {
         _inputRef = -1;
         _literal = ((RexExpression.Literal) rexExpression).getValue();
-        dataType = DataSchema.ColumnDataType.fromDataType(rexExpression.getDataType(), false);
+        _dataType = DataSchema.ColumnDataType.fromDataType(rexExpression.getDataType(), true);

Review Comment:
   this is a bug fix for a MV/SV value generator



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org