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

SparkSQL regexpExpressions example

    XMLWordPrintableJSON

    Details

    • Type: Documentation
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.4.0
    • Component/s: Examples
    • Labels:
      None
    • Flags:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: