You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/04 00:51:00 UTC

[jira] [Commented] (FLINK-9990) Add regex_extract supported in TableAPI and SQL

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

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

walterddr commented on a change in pull request #6448: [FLINK-9990] [table] Add regex_extract supported in TableAPI and SQL
URL: https://github.com/apache/flink/pull/6448#discussion_r207694473
 
 

 ##########
 File path: docs/dev/table/sql.md
 ##########
 @@ -1842,6 +1842,16 @@ RPAD(text string, len integer, pad string)
     <tr>
       <td>
         {% highlight text %}
+REGEX_EXTRACT(str string, regex string, extractIndex integer)
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Returns the string str extracted using specified regex pattern and index. If str or regex is null, returns null. E.g. <code>REGEX_EXTRACT('foothebar', 'foo(.*?)(bar)', 2)</code> returns <code>bar</code>.</p>
 
 Review comment:
   Also similar to SQL array, might be good to point out that the index starts with 1.

----------------------------------------------------------------
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 regex_extract supported in TableAPI and SQL
> -----------------------------------------------
>
>                 Key: FLINK-9990
>                 URL: https://issues.apache.org/jira/browse/FLINK-9990
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API &amp; SQL
>            Reporter: vinoyang
>            Assignee: vinoyang
>            Priority: Minor
>              Labels: pull-request-available
>
> regex_extract is a very useful function, it returns a string based on a regex pattern and a index.
> For example : 
> {code:java}
> regexp_extract('foothebar', 'foo(.*?)(bar)', 2) // returns 'bar.'
> {code}
> It is provided as a UDF in Hive, more details please see[1].
> [1]: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF



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