zzchun 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_r282095106
##########
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:
Good idea, I've changed to `StringBuilder `
----------------------------------------------------------------
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