Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-21261

SparkSQL regexpExpressions example

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.1
    • 2.4.0
    • Examples
    • None
    • Patch

    Description

      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

      Attachments

        Activity

          People

            srowen Sean R. Owen
            visaxin zhangxin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: