-
- Downloads
[SPARK-16409][SQL] regexp_extract with optional groups causes NPE
## What changes were proposed in this pull request? regexp_extract actually returns null when it shouldn't when a regex matches but the requested optional group did not. This makes it return an empty string, as apparently designed. ## How was this patch tested? Additional unit test Author: Sean Owen <sowen@cloudera.com> Closes #14504 from srowen/SPARK-16409.
Showing
- python/pyspark/sql/functions.py 3 additions, 0 deletionspython/pyspark/sql/functions.py
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala 11 additions, 2 deletions...he/spark/sql/catalyst/expressions/regexpExpressions.scala
- sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala 8 additions, 0 deletions...est/scala/org/apache/spark/sql/StringFunctionsSuite.scala
Loading
Please register or sign in to comment