Skip to content

[core] Add versioned split serializer#8482

Open
JingsongLi wants to merge 2 commits into
apache:masterfrom
JingsongLi:codex/split-serializer-protocol
Open

[core] Add versioned split serializer#8482
JingsongLi wants to merge 2 commits into
apache:masterfrom
JingsongLi:codex/split-serializer-protocol

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Summary

Introduce a versioned binary serializer for non-system table Split implementations so split metadata can be exchanged by Java and Rust runtimes through a stable protocol.

Changes

  • Add SplitSerializer with a SPLIT_V1 frame, serializer version, and stable type ids for DataSplit, IncrementalSplit, IndexedSplit, ChainSplit, QueryAuthSplit, and fallback split variants.
  • Update QueryAuthSplit and FallbackSplitImpl to use custom serialization paths instead of Java default object serialization.
  • Add round-trip and golden-file compatibility coverage, including generated golden files for all supported split variants.

Testing

  • mvn -pl paimon-core -Pfast-build -DgenerateSplitGoldenFiles=true -Dtest=SplitSerializerTest,QueryAuthSplitTest -Dmaven.main.skip=true test
  • mvn -pl paimon-core -Pfast-build -Dtest=SplitSerializerTest,QueryAuthSplitTest -Dmaven.main.skip=true test
  • mvn -pl paimon-core spotless:check
  • git diff --check
  • JDK 8 javac compile for the changed main classes

Notes

FormatDataSplit and object table splits are intentionally excluded from this protocol.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. The versioned split serializer protocol now has stable type ids and golden-file coverage, and the targeted paimon-core tests pass locally.

serialize(new DataOutputViewStreamWrapper(out));
}

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This breaks Java serialization compatibility for QueryAuthSplit. Old Flink checkpoints use the previous default object stream, but readObject now expects the new SplitSerializer format. I reproduced restore as EOFException.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is expected. Firstly, cross version compatibility is not guaranteed, and secondly, QueryAuthSplit is generally not saved in Flink state.

However, I should indeed increase the serial Version UID to make the exception more apparent.

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.

3 participants