Skip to content

Conversation

@harshmotw-db
Copy link
Contributor

What changes were proposed in this pull request?

This PR makes minor changes to test suites so that they pass with variant shredding-related configs enabled, without hurting the purpose of the tests.

Why are the changes needed?

These changes would help tests pass if shredding configs were enabled by default in the future.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests.

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Nov 27, 2025
@cloud-fan cloud-fan changed the title [SPARK-54522] Variant test suite fixes for shredding configs [SPARK-54522][SQL][TEST] Variant test suite fixes for shredding configs Nov 27, 2025
val keyIterator = (0 until numKeys).iterator
// We start in long range because the shredded writer writes int64 by default which wouldn't
// match narrower binaries.
val keyIterator = (Int.MaxValue + 1L until Int.MaxValue + 1L + numKeys).iterator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a regression because it increases the memory requirement heavily, doesn't it, @harshmotw-db ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dongjoon-hyun it's still numKeys elements, it just changes the starting value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Initially, I worried about the size because numKeys was 128k. After I computed the actual values, I also realized that it doesn't increase effectively.

val numKeys = 128 * 1024
val keyIterator1 = (0 until numKeys).iterator
val keyIterator2 = (Int.MaxValue + 1L until Int.MaxValue + 1L + numKeys).iterator
val entries1 = Array.fill(numKeys)(s"""\"${keyIterator1.next()}\": \"test\"""")
val entries2 = Array.fill(numKeys)(s"""\"${keyIterator2.next()}\": \"test\"""")
val jsonStr1 = s"{${entries1.mkString(", ")}}"
val jsonStr2 = s"{${entries2.mkString(", ")}}"

scala> jsonStr1.length
val res1: Int = 2248186

scala> jsonStr2.length
val res2: Int = 2883584

Thanks.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a regression on the test, can we explicit set the configuration requirement at the beginning of the test case, @harshmotw-db ?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @harshmotw-db and @cloud-fan .
Merged to master/4.1.

dongjoon-hyun pushed a commit that referenced this pull request Nov 28, 2025
### What changes were proposed in this pull request?

This PR makes minor changes to test suites so that they pass with variant shredding-related configs enabled, without hurting the purpose of the tests.

### Why are the changes needed?

These changes would help tests pass if shredding configs were enabled by default in the future.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests.

### Was this patch authored or co-authored using generative AI tooling?

No

Closes #53242 from harshmotw-db/harshmotw-db/suite_fixes.

Authored-by: Harsh Motwani <harsh.motwani@databricks.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 5b0a667)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants