Skip to content

[SPARK-56200][CORE] Remove jackson JSON nesting depth limitation #55004

Open
lsm1 wants to merge 1 commit intoapache:masterfrom
lsm1:features/json-next-limit
Open

[SPARK-56200][CORE] Remove jackson JSON nesting depth limitation #55004
lsm1 wants to merge 1 commit intoapache:masterfrom
lsm1:features/json-next-limit

Conversation

@lsm1
Copy link

@lsm1 lsm1 commented Mar 25, 2026

What changes were proposed in this pull request?

This PR updates JsonProtocol to remove Jackson nesting-depth limits for both reading and writing JSON, in addition to the existing string-length relaxation from SPARK-49872

It also fixes serialization/deserialization paths for deep event-log JSON nodes by replacing toString-based conversion with Jackson mapper serialization (mapper.writeValueAsString(...)) in:

  • sparkEventFromJson
  • resourcesMapFromJson

These changes make deep nested event-log payloads and resource JSON parsing more robust and consistent with Jackson serialization semantics.

Why are the changes needed?

With deeply nested JSON payloads, default Jackson stream constraints can fail with depth-limit exceptions during read/write, which can affect Spark listener event log handling.

Also, converting JsonNode via toString can produce inconsistent behavior in some deep/complex cases. Using Jackson mapper-based serialization ensures stable JSON conversion before parsing into Spark event/resource types.

Does this PR introduce any user-facing change?

Yes.

For users who have deeply nested JSON content in Spark event logs or resource-related JSON, operations that previously could fail due to Jackson depth constraints (for read/write) will now succeed. This is a behavior fix (robustness improvement), not a new API.

How was this patch tested?

No new tests were added in this patch.

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

no

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.

1 participant