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

Ensure repartition overflow test always overflows #11614

Merged
merged 1 commit into from
Oct 16, 2024
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
12 changes: 6 additions & 6 deletions integration_tests/src/main/python/repart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,16 @@ def test_hash_repartition_exact_longs_no_overflow(num_parts, is_ansi_mode):
@pytest.mark.parametrize('num_parts', [17], ids=idfn)
@allow_non_gpu(*non_utc_allow)
def test_hash_repartition_long_overflow_ansi_exception(num_parts):
data_gen = [('a', long_gen)]
part_on = [f.col('a') + 15]
conf = ansi_enabled_conf

def test_function(spark):
return gen_df(spark, data_gen, length=1024) \
.withColumn('plus15', f.col('a') + 15) \
.repartition(num_parts, f.col('plus15')) \
df = gen_df(spark, [('a', long_gen)], length=1024)
maxVal = df.selectExpr("max(a) as m").head()['m']
overflowVal = (1 << 63) - maxVal
return df.withColumn('plus', f.col('a') + overflowVal) \
.repartition(num_parts, f.col('plus')) \
.withColumn('id', f.spark_partition_id()) \
.withColumn('hashed', f.hash(*part_on)) \
.withColumn('hashed', f.hash(f.col('a') + overflowVal)) \
.selectExpr('*', 'pmod(hashed, {})'.format(num_parts))

assert_gpu_and_cpu_error(
Expand Down