[spark] Use jackson shaded by Paimon instead of Spark's built-in one#8479
Merged
Merged
Conversation
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix the todo left in
paimon-spark/pom.xmlby #6082:<!-- todo(fix me): we should use the jackson libraries shaded by Paimon. -->JsonUtilsin paimon-spark-common was the only Scala code still using the unshaded jackson resolved from Spark's runtime (the spotless import-replacement rule that rewrites jackson imports to the shaded ones only applies to Java sources). So the jackson version it ran on was decided entirely by the Spark version (2.15.x for Spark 3.5, 2.18.x for Spark 4.x), which may differ from the version Paimon expects.This PR:
PaimonSourceOffsetjson serde (the only user ofJsonUtils) withJsonSerdeUtil.OBJECT_MAPPER_INSTANCE, i.e. the jackson shaded by Paimon.ScalaObjectMapper/DefaultScalaModulecannot be kept becausepaimon-shade-jackson-2does not bundlejackson-module-scala; since the offset only has 3 primitive fields, the serde is written manually. The JSON field names and layout stay exactly the same, so streaming checkpoints remain compatible in both directions.JsonUtils.com.fasterxml.jackson.core:*exclusion onpaimon-formatitself is correct (paimon-format already shades jackson into its jar) and is kept.Tests
Covered by existing
PaimonSourceTest, which asserts offset json round-trips throughquery.lastProgress.sources(0).endOffset.