dianfu commented on a change in pull request #9858: [FLINK-14208][python] 
Optimize Python UDFs with parameters of constant values
URL: https://github.com/apache/flink/pull/9858#discussion_r332985101
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/nodes/CommonPythonCalc.scala
 ##########
 @@ -54,6 +57,10 @@ trait CommonPythonCalc {
           val argPythonInfo = createPythonScalarFunctionInfo(pythonRexCall, 
inputNodes)
           inputs.append(argPythonInfo)
 
+        case literal: RexLiteral =>
+          inputs.append(
+            rexLiteralToPythonObject.invoke(null, literal.getValue3, 
literal.getTypeName))
 
 Review comment:
   Should convert `literal.getValue3` to the actual type. For example, for 
bigint type, the type of `literal.getValue3` is `BigDecimal`, which is not 
correct. You can refer to `CodeGenerator#visitLiteral` for more information on 
how to do that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to