Ma77Ball opened a new pull request, #5322: URL: https://github.com/apache/texera/pull/5322
### What changes were proposed in this PR? - Rewrote `JSONUtils.JSONToMap` from per-level recursion into an iterative traversal over a `(JsonNode, parentName)` worklist (a `mutable.Stack`), so nesting depth lives on the heap instead of the JVM call stack. - Per-node logic is unchanged: objects emit value entries and (in flatten mode) push their object/array children, arrays push each element keyed by 1-based index, and value nodes with a parent emit their text. Output keys and values are identical to before. - Added a `JSONUtilsSpec` case that flattens a 20,000-deep object (built programmatically to bypass Jackson's own parser nesting cap), which would previously have thrown `StackOverflowError`. ### Any related issues, documentation, or discussions? Closes: #5321 ### How was this PR tested? - Ran `WorkflowCore/testOnly org.apache.texera.amber.util.JSONUtilsSpec`: all 16 tests pass (15 pre-existing behavior cases plus the new deep-nesting case). - Ran `sbt scalafmtAll` (clean, no files rewritten beyond the two edited). ### Was this PR authored or co-authored using generative AI tooling? Co-authored with Claude Opus 4.7 in compliance with ASF -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
