Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions integration_tests/src/main/python/regexp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,12 +1498,18 @@ def run_test(spark):
assert "INVALID_PARAMETER_VALUE.PATTERN" in cpu_error
assert "Illegal" in gpu_error # GPU still uses old format

@datagen_overrides(seed=0, reason='https://github.com/NVIDIA/spark-rapids/issues/9731')
def test_re_replace_all():
"""
regression test for https://github.com/NVIDIA/spark-rapids/issues/8323
"""
gen = mk_str_gen('[a-z]{0,2}\n{0,2}[a-z]{0,2}\n{0,2}')
# Retain the NEL regression inputs from https://github.com/NVIDIA/cudf-spark/issues/9731
# while allowing the rest of the input to vary with the test seed.
gen = mk_str_gen('[a-z]{0,2}\n{0,2}[a-z]{0,2}\n{0,2}') \
.with_special_case('a\u0085') \
.with_special_case('oNÍ[\x87\x01áe>\u0085') \
.with_special_case('a\u2028') \
.with_special_case('a\u2029') \
.with_special_case('a\r\n')
assert_gpu_and_cpu_are_equal_collect(
lambda spark: unary_op_df(spark, gen).selectExpr(
'REGEXP_REPLACE(a, ".*$", "PROD", 1)'),
Expand Down
10 changes: 8 additions & 2 deletions integration_tests/src/main/python/window_function_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
import math
import pytest
import re

from asserts import assert_gpu_and_cpu_are_equal_collect, assert_gpu_and_cpu_are_equal_sql, assert_gpu_and_cpu_error, assert_gpu_fallback_collect, assert_gpu_sql_fallback_collect
from data_gen import *
Expand All @@ -21,7 +22,7 @@
from pyspark.sql.types import DateType, TimestampType, NumericType
from pyspark.sql.window import Window
import pyspark.sql.functions as f
from spark_session import is_before_spark_320, is_databricks113_or_later, \
from spark_session import is_before_spark_320, is_databricks113_or_later, is_databricks_runtime, \
is_spark_350_or_later, spark_version, with_cpu_session, \
is_scala212, is_spark_340_or_later, is_spark_420_or_later
import warnings
Expand Down Expand Up @@ -3084,7 +3085,12 @@ def spark_bugs_in_decimal_sorting():
:return: True, if Apache Spark version does not sort Decimal(>20, >2) correctly. False, otherwise.
"""
v = spark_version()
return v < "3.1.4" or v < "3.3.1" or v < "3.2.3" or v < "3.4.0"
# SPARK-40089 was backported to Apache Spark 3.3.1. Only narrow the guard for
# Apache 3.3 releases; retain the existing guard for older and vendor runtimes.
apache_33 = re.fullmatch(r"3\.3\.([0-9]+)", v)
if apache_33 and not is_databricks_runtime():
return int(apache_33[1]) == 0
Comment on lines +3091 to +3093
return v < "3.4.0"


@ignore_order(local=True)
Expand Down
Loading