You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/01/07 08:04:00 UTC
[jira] [Resolved] (SPARK-26552) Extract a map from a string
identified by java regex
[ https://issues.apache.org/jira/browse/SPARK-26552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-26552.
----------------------------------
Resolution: Won't Fix
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org