[ 
https://issues.apache.org/jira/browse/FLINK-9970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16560608#comment-16560608
 ] 

ASF GitHub Bot commented on FLINK-9970:
---------------------------------------

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

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
 ##########
 @@ -544,11 +544,22 @@ trait ImplicitExpressionOperations {
   def overlay(newString: Expression, starting: Expression, length: Expression) 
=
     Overlay(expr, newString, starting, length)
 
+  /**
+    * Returns the numeric value of the leftmost character of the string.
+    */
+  def ascii() = Ascii(expr)
+
   /**
     * Returns the base string decoded with base64.
     */
   def fromBase64() = FromBase64(expr)
 
+  /*
+    * Returns string contains a character which converts from a ASCII integer.
 
 Review comment:
    Returns the character corresponding to the input ASCII integer. If the 
ASCII code less then 0 or greater than 255, returns null.

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


> Add ASCII/CHR function for table/sql API
> ----------------------------------------
>
>                 Key: FLINK-9970
>                 URL: https://issues.apache.org/jira/browse/FLINK-9970
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: vinoyang
>            Assignee: vinoyang
>            Priority: Minor
>              Labels: pull-request-available
>
> for ASCII function : 
> refer to : 
> [https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_ascii]
> for CHR function : 
> This function convert ASCII code to a character,
> refer to : [https://doc.ispirer.com/sqlways/Output/SQLWays-1-071.html]
> Considering "CHAR" always is a keyword in many database, so we use "CHR" 
> keyword.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to