xccui commented on a change in pull request #6432: [FLINK-9970] [table] Add ASCII/CHR function for table/sql API URL: https://github.com/apache/flink/pull/6432#discussion_r225319289
########## File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala ########## @@ -285,4 +296,15 @@ object ScalarFunctions { */ def repeat(base: String, n: Int): String = StringUtils.repeat(base, n) + /** + * Returns a character corresponding to the input integer ASCII code. + */ + def chr(ascii: Long): String = { + if (ascii == null || ascii < 0 || ascii > 255) { Review comment: As far as I know, when the input exceeding the range (1 - 255), the behavior of the `chr()` function differs in some databases. It's fine to return a `null` value and maybe we should mention that in the documentation. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services