flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-10145) Add replace supported in TableAPI and SQL
Date Tue, 21 Aug 2018 02:17:00 GMT

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

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

xccui commented on a change in pull request #6576: [FLINK-10145][table] Add replace supported
in TableAPI and SQL
URL: https://github.com/apache/flink/pull/6576#discussion_r211460298
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala
 ##########
 @@ -92,6 +92,17 @@ object ScalarFunctions {
     sb.toString
   }
 
+  /**
+    * Returns the string str with all non-overlapping occurrences
+    * of search replaced with replacement.
+    */
+  def replace(str: String, search: String, replacement: String): String = {
 
 Review comment:
   The `replace()` method has been provided in `org.apache.calcite.runtime.SqlFunctions`.

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


> Add replace supported in TableAPI and SQL
> -----------------------------------------
>
>                 Key: FLINK-10145
>                 URL: https://issues.apache.org/jira/browse/FLINK-10145
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API &amp; SQL
>            Reporter: Guibo Pan
>            Assignee: Guibo Pan
>            Priority: Major
>              Labels: pull-request-available
>
> replace is an useful function for String. 
> for example:
> {code:java}
> select replace("Hello World", "World", "Flink") // return "Hello Flink"
> select replace("ababab", "abab", "z") // return "zab"
> {code}
> It is supported as a UDF in Hive, more details please see[1]
> [1]: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-StringFunctions



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

Mime
View raw message