You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/11/14 18:30:01 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #9795: [multistage][hotfix] typo in cast

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


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -54,10 +54,8 @@ static RexExpression handleCast(RexCall rexCall) {
         rexCall.getOperands().stream().map(RexExpression::toRexExpression).collect(Collectors.toList());
     Preconditions.checkState(operands.size() == 1, "CAST takes exactly 2 arguments");
     RelDataType castType = rexCall.getType();
-    // add the 2nd argument as the source type info.
-    operands.add(new RexExpression.Literal(FieldSpec.DataType.STRING,
-        RexExpression.toPinotDataType(rexCall.getOperands().get(0).getType()).name()));
-    return new RexExpression.FunctionCall(rexCall.getKind(), RexExpression.toDataType(rexCall.getType()), "CAST",
+    operands.add(new RexExpression.Literal(FieldSpec.DataType.STRING, RexExpression.toPinotDataType(castType).name()));
+    return new RexExpression.FunctionCall(rexCall.getKind(), RexExpression.toDataType(castType), "CAST",

Review Comment:
   this works for so long b/c of the way pinot leaf stage is so forgiving. 
   (and intermediate stage is following this to some extend b/c of the reuse in v1 logic)



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