Skip to content

Commit

Permalink
add multiline test
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Dec 6, 2021
1 parent 1021205 commit 90f174f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integration_tests/src/main/python/string_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,13 @@ def test_regexp_extract():
'regexp_extract(a, "^([a-d]*)([0-9]*)([a-d]*)$", 3)'),
conf={'spark.rapids.sql.expression.RegExpExtract': 'true'})

def test_regexp_extract_multiline():
gen = mk_str_gen('[abcd]{2}[\r\n]{0,2}[0-9]{2}[\r\n]{0,2}[abcd]{2}')
assert_gpu_and_cpu_are_equal_collect(
lambda spark: unary_op_df(spark, gen).selectExpr(
'regexp_extract(a, "^([a-d]*)([\r\n]*)", 2)'),
conf={'spark.rapids.sql.expression.RegExpExtract': 'true'})

def test_regexp_extract_multiline_negated_character_class():
gen = mk_str_gen('[abcd]{2}[\r\n]{0,2}[0-9]{2}[\r\n]{0,2}[abcd]{2}')
assert_gpu_and_cpu_are_equal_collect(
Expand Down

0 comments on commit 90f174f

Please sign in to comment.