yanghua commented on a change in pull request #6432: [FLINK-9970] Add ASCII/CHR
function for table/sql API
URL: https://github.com/apache/flink/pull/6432#discussion_r206376636
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/FunctionGenerator.scala
##########
@@ -146,12 +146,25 @@ object FunctionGenerator {
STRING_TYPE_INFO,
BuiltInMethod.OVERLAY.method)
+ addSqlFunctionMethod(
+ ASCII,
+ Seq(STRING_TYPE_INFO),
+ STRING_TYPE_INFO,
Review comment:
I know that in normal scenarios, we should return an int, but we need to
handle the input exception properly. We need to return null in the case where
the input is null, and return "" if the input is "". If we return the int type
directly, then we have difficulty dealing with these two exception scenarios.
So I chose to return a string representation of the numeric type.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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