You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/08 14:14:23 UTC

[GitHub] [flink] chunweilei commented on a change in pull request #8372: [FLINK-12354] [table] Add REVERSE function for table/sql API

chunweilei commented on a change in pull request #8372: [FLINK-12354] [table] Add REVERSE function for table/sql API
URL: https://github.com/apache/flink/pull/8372#discussion_r282086176
 
 

 ##########
 File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala
 ##########
 @@ -296,4 +296,10 @@ object ScalarFunctions {
     */
   def repeat(base: String, n: Int): String = EncodingUtils.repeat(base, n)
 
+  /**
+    * Returns the string with the order of characters reversed.
+    */
+  def reverse(base: String): String = {
+    new StringBuffer(base).reverse().toString
+  }
 
 Review comment:
   Using `StringBuilder` may be better.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services