You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2018/07/18 17:29:00 UTC

[jira] [Commented] (SPARK-21261) SparkSQL regexpExpressions example

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

Apache Spark commented on SPARK-21261:
--------------------------------------

User 'srowen' has created a pull request for this issue:
https://github.com/apache/spark/pull/21808

> SparkSQL regexpExpressions example 
> -----------------------------------
>
>                 Key: SPARK-21261
>                 URL: https://issues.apache.org/jira/browse/SPARK-21261
>             Project: Spark
>          Issue Type: Documentation
>          Components: Examples
>    Affects Versions: 2.1.1
>            Reporter: zhangxin
>            Priority: Major
>
> The follow execute result.
> scala> spark.sql(""" select regexp_replace('100-200', '(\d+)', 'num') """).show
> +----------------------------------+
> |regexp_replace(100-200, (d+), num)|
> +----------------------------------+
> |                           100-200|
> +----------------------------------+
> scala> spark.sql(""" select regexp_replace('100-200', '(\\d+)', 'num') """).show
> +-----------------------------------+
> |regexp_replace(100-200, (\d+), num)|
> +-----------------------------------+
> |                            num-num|
> +-----------------------------------+
> Add Comment



--
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