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

Fix java.lang.IndexOutOfBoundsException: No group -1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, 3.1.0
    • Fix Version/s: 3.0.1, 3.1.0
    • Component/s: SQL
    • Labels:
      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

            • Assignee:
              beliefer jiaan.geng
              Reporter:
              beliefer jiaan.geng
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: