GitHub user srowen opened a pull request: https://github.com/apache/spark/pull/14504
[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 You can merge this pull request into a Git repository by running: $ git pull https://github.com/srowen/spark SPARK-16409 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/14504.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14504 ---- commit 6259c06d72da9c8350c772dea892fdc96b77fb3d Author: Sean Owen <so...@cloudera.com> Date: 2016-08-05T05:33:32Z Handle case that regex matches, but group does not, in regexp_extract commit 75d62ae1ce5c33a8c4929aa3500aba1ebb916a09 Author: Sean Owen <so...@cloudera.com> Date: 2016-08-05T06:20:50Z Add test for non-matching optional group in regexp_extract ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org