[ 
https://issues.apache.org/jira/browse/SPARK-26552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Apache Spark reassigned SPARK-26552:
------------------------------------

    Assignee:     (was: Apache Spark)

> Extract a map from a string identified by java regex
> ----------------------------------------------------
>
>                 Key: SPARK-26552
>                 URL: https://issues.apache.org/jira/browse/SPARK-26552
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.5.0
>            Reporter: wenshangmin
>            Priority: Minor
>
> New function regexp_to_map should convert a column of string with a regex to 
> a map column with group names as keys and group values as values.
> Based on that, we can use it like a table. One common use is to analysis the 
> log file.
> {code}
> def regexp_to_map(e: Column, exp: String): Column
> {code}
>  
> Here is an example of usage:
> {code:sql}
> select temp.col1 from
> select regexp_to_map("100-200", "(?<col1>\\d+)-(?<col2>\\d+)") as temp;
> {code}
> {code:java}
> 100{code}
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to