Skip to content

Optimize native shuffle to write schema once per output partition instead of once per batch #2928

Closed as not planned

Description

@andygrove

What is the problem the feature request solves?

Native shuffle currently encodes the name of the compression codec and the IPC schema once per batch. Storing the schema per batch was originally a requirement because the schema could vary between batches due to dictionary encoding but this is no longer the case.

Describe the potential solution

Write the compression codec name and schema once per partittion. This can be implemented in ShuffleBlockWriter::try_new. Update ShuffleBlockWriter::write_batch to no longer write the header per batch.

Make corresponding changes in the reader NativeBlockDecoderIterator.scala.

We need to make sure that this approach works correctly with spilling as well.

Additional context

No response

Activity

  1. added this to the 0.13.0 milestone on Dec 17, 2025
  2. self-assigned this
    on Dec 17, 2025
  3. modified the milestones: 0.13.0, 0.14.0 on Dec 17, 2025
  4. andygrove commented on Dec 17, 2025

    @andygrove
    MemberAuthor

    I ran some experiments and I no longer think that this is worth doing. For batches with a tiny schema (e.g. single column) I saw a ~25% reduction in size when re-using a single encoder and stream writer across all batches, but this quickly dropped to ~1% once using batches with 100 columns of mixed types.

  5. andygrove commented on Dec 23, 2025

    @andygrove
    MemberAuthor

    There could still be some CPU savings by writing the schema less often, even if it does not help much with file size.

  6. removed this from the 0.14.0 milestone on Mar 12, 2026
  7. andygrove commented on May 6, 2026

    @andygrove
    MemberAuthor

    I am no longer pursuing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions