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:
[email protected]


With regards,
Apache Git Services

Reply via email to