Skip to content

[spark] preserve the streaming flag when packing data splits. - #11446

Open
fengruotj wants to merge 1 commit into
apache:masterfrom
fengruotj:fix/spark-preserve-streaming-flag-in-split-packing
Open

fengruotj wants to merge 1 commit into
apache:masterfrom
fengruotj:fix/spark-preserve-streaming-flag-in-split-packing

Conversation

@fengruotj

@fengruotj fengruotj commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Closes #11435 .

This PR fixes missing changes in Spark incremental audit log queries when multiple changelog files contain records with the same primary key.

BinPackingSplits.copyDataSplit does not preserve the original split's isStreaming flag. The copied split defaults to false, causing the reader to merge records by primary key instead of preserving individual changes. For example, an incremental audit log
query covering +I(1, 10), +U(1, 20), and +U(1, 30) only returns +U(1, 30).

This PR preserves isStreaming when copying data splits so that the original read semantics are retained after split packing.

Tests

Added a regression test in TableValuedFunctionsTest that writes three values for the same primary key, performs a full compaction after each write, and verifies that the incremental audit log query returns all three changes.

The regression test fails before the fix and passes afterward. All 32 tests in TableValuedFunctionsTest and BinPackingSplitsTest passed with Spark 3.5.9.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Spark incremental audit log queries lose earlier changes for the same primary key

1 participant