Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_div_overflow_exception_when_ansi test for Spark-3.3 [databricks] #5601

Merged
merged 1 commit into from
May 24, 2022
Merged
Changes from all commits
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
4 changes: 3 additions & 1 deletion integration_tests/src/main/python/arithmetic_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,11 +836,13 @@ def _get_div_overflow_df(spark, expr):
@pytest.mark.parametrize('ansi_enabled', ['false', 'true'])
def test_div_overflow_exception_when_ansi(expr, ansi_enabled):
ansi_conf = {'spark.sql.ansi.enabled': ansi_enabled}
exception_str = "java.lang.ArithmeticException: Overflow in integral divide" if is_before_spark_330() \
else "org.apache.spark.SparkArithmeticException: Overflow in integral divide"
if ansi_enabled == 'true':
assert_gpu_and_cpu_error(
df_fun=lambda spark: _get_div_overflow_df(spark, expr).collect(),
conf=ansi_conf,
error_message='java.lang.ArithmeticException: Overflow in integral divide')
error_message=exception_str)
else:
assert_gpu_and_cpu_are_equal_collect(
func=lambda spark: _get_div_overflow_df(spark, expr),
Expand Down