Jackie-Jiang commented on code in PR #13282:
URL: https://github.com/apache/pinot/pull/13282#discussion_r1621891622


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/AggregateOperator.java:
##########
@@ -244,78 +215,26 @@ private TransferableBlock consumeAggregation() {
       return COUNT_STAR_AGG_FUNCTION;
     }
     List<ExpressionContext> arguments = new ArrayList<>(numArguments);
-    for (int i = 0; i < numArguments; i++) {
-      Literal literalArgument = literalArguments.get(i);
-      if (literalArgument != null) {
-        arguments.add(ExpressionContext.forLiteralContext(literalArgument));
+    for (RexExpression operand : operands) {
+      if (operand instanceof RexExpression.InputRef) {
+        RexExpression.InputRef inputRef = (RexExpression.InputRef) operand;
+        
arguments.add(ExpressionContext.forIdentifier(fromColIdToIdentifier(inputRef.getIndex())));
       } else {
-        RexExpression operand = operands.get(i);
-        switch (operand.getKind()) {
-          case INPUT_REF:
-            RexExpression.InputRef inputRef = (RexExpression.InputRef) operand;
-            
arguments.add(ExpressionContext.forIdentifier(fromColIdToIdentifier(inputRef.getIndex())));
-            break;
-          case LITERAL:
-            RexExpression.Literal literalRexExp = (RexExpression.Literal) 
operand;
-            
arguments.add(ExpressionContext.forLiteralContext(literalRexExp.getDataType().toDataType(),
-                literalRexExp.getValue()));
-            break;
-          default:
-            throw new IllegalStateException("Illegal aggregation function 
operand type: " + operand.getKind());
+        assert operand instanceof RexExpression.Literal;

Review Comment:
   It won't be. We only extract literal as operand, others will remain input 
reference.



-- 
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]

Reply via email to