JingsongLi commented on a change in pull request #10399: [FLINK-14959][table-planner-blink] Support precision of LocalZonedTimestampType in blink planner URL: https://github.com/apache/flink/pull/10399#discussion_r354660583
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarFunctionCallGen.scala ########## @@ -70,13 +70,21 @@ class ScalarFunctionCallGen(scalarFunction: ScalarFunction) extends CallGenerato val resultExternalType = UserDefinedFunctionUtils.getResultTypeOfScalarFunction( scalarFunction, arguments, operandTypes) val setResult = { - if (resultClass.isPrimitive) { + if (resultClass.isPrimitive && isInternalClass(resultExternalType)) { s"$resultTerm = $evalResult;" } else { val javaTerm = newName("javaResult") // it maybe a Internal class, so use resultClass is most safety. - val javaTypeTerm = resultClass.getCanonicalName - val internal = genToInternalIfNeeded(ctx, resultExternalType, javaTerm) + val boxedResultClass = boxedTypeForUnboxType(resultClass) + val javaTypeTerm = boxedResultClass.getCanonicalName + val resultExternalTypeWithResultClass = + if (resultExternalType.getLogicalType.supportsOutputConversion(boxedResultClass)) { Review comment: Have you considered UDTF and UDAF? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services