You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "benj (Jira)" <ji...@apache.org> on 2019/09/02 12:45:00 UTC

[jira] [Comment Edited] (DRILL-6968) pattern matching and regexp facilities and unnest

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

benj edited comment on DRILL-6968 at 9/2/19 12:44 PM:
------------------------------------------------------

The _split_to_array_ is currently well defined as *split()* function (from drill 1.7).
Note that the internet documentation is not up to date (the split function doesn't appears in https://drill.apache.org/docs/string-manipulation/). But the book "Learning Apache Drill p.47 is well updated).

But for the _*split_to_table*_ I don't know how to return multiple row in an UDF. Is it really possible now ?


was (Author: benj641):
The _split_to_array_ is currently well defined as *split()* function (from drill 1.7). Note that the internet documentation is not up to date (the split function doesn't appears inhttps://drill.apache.org/docs/string-manipulation/). But the book "Learning Apache Drill p.47 is well updated).

But for the _*split_to_table*_ I don't know how to return multiple row in an UDF. Is it really possible now ?

> pattern matching and regexp facilities and unnest
> -------------------------------------------------
>
>                 Key: DRILL-6968
>                 URL: https://issues.apache.org/jira/browse/DRILL-6968
>             Project: Apache Drill
>          Issue Type: Wish
>          Components: Functions - Drill
>    Affects Versions: 1.15.0
>            Reporter: benj
>            Priority: Major
>
> Although it is possible to do some of them self, adding some possibilities from pattern matching directly in DRILL
>  * may be usefull,
>  * would prevent (re)write them and check again and again,
>  * would allow a quicker and more effective handling of Drill.
> Some propositions :
>  * adding possibilities to regexp_replace (ignoreCase, replaceAll(currently)/replaceOnlyFirst ...)
>  * regexp_matches (lighter and more consistent than using regexp_replace trick)
>  * split_to_table
> {noformat}
> SELECT split_to_table('Drill,baby,drill',',') AS mywords, 1 AS x;
> +---------+---+
> | mywords | x |
> +---------+---+
> | Drill   | 1 |
> | baby    | 1 |
> | drill   | 1 |
> +---------+---+
> {noformat}
>  * split_to_array
> {noformat}
> SELECT split_to_array('Drill,baby,drill',',') AS mywords, 1 AS x;
> +---------------------------+---+
> | mywords                   | x |
> +---------------------------+---+
> | ["Drill","baby","drill"]  | 1 |
> +---------------------------+---+
> {noformat}
>  * ...



--
This message was sent by Atlassian Jira
(v8.3.2#803003)