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

Fix java.lang.IndexOutOfBoundsException: No group -1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.1, 3.1.0
    • 3.0.1, 3.1.0
    • SQL
    • None

    Description

      The current implement of regexp_extract will throws a unprocessed exception show below:

      SELECT regexp_extract('1a 2b 14m', 'd+' -1)

      java.lang.IndexOutOfBoundsException: No group -1
      java.util.regex.Matcher.group(Matcher.java:538)
      org.apache.spark.sql.catalyst.expressions.RegExpExtract.nullSafeEval(regexpExpressions.scala:455)
      org.apache.spark.sql.catalyst.expressions.TernaryExpression.eval(Expression.scala:704)
      org.apache.spark.sql.catalyst.optimizer.ConstantFolding$$anonfun$apply$1$$anonfun$applyOrElse$1.applyOrElse(expressions.scala:52)
      org.apache.spark.sql.catalyst.optimizer.ConstantFolding$$anonfun$apply$1$$anonfun$applyOrElse$1.applyOrElse(expressions.scala:45)
      

      Attachments

        Activity

          People

            beliefer Jiaan Geng
            beliefer Jiaan Geng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: