maropu commented on a change in pull request #27508: [SPARK-30763][SQL] Fix 
java.lang.IndexOutOfBoundsException No group 1 for regexp_extract
URL: https://github.com/apache/spark/pull/27508#discussion_r376778344
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/regexp-function.sql
 ##########
 @@ -0,0 +1,15 @@
+SELECT regexp_extract('1a 2b 14m', '\\d+');
+
+SELECT regexp_extract('1a 2b 14m', '\\d+', 0);
+
+SELECT regexp_extract('1a 2b 14m', '\\d+', 1);
+
+SELECT regexp_extract('1a 2b 14m', '\\d+', 2);
+
+SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)');
+
+SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 0); 
+
+SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 1); 
+
+SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 2);
 
 Review comment:
   ~Can you move these tests into `sql-tests/inputs/string-functions.sql` 
insteadf of making a new file?~
   nvm, my bad.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to