[VL] Fix json_tuple rewrite producing incompatible JSON path in fallback scenarios#12038
Merged
philo-he merged 4 commits intoapache:mainfrom May 9, 2026
Merged
[VL] Fix json_tuple rewrite producing incompatible JSON path in fallback scenarios#12038philo-he merged 4 commits intoapache:mainfrom
philo-he merged 4 commits intoapache:mainfrom
Conversation
Contributor
Author
|
The failure ci should be unrelated, CC @lyy-pineapple @philo-he for a look thanks |
Member
|
Thank you for the PR. |
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.
What changes are proposed in this pull request?
When
json_tupleis rewritten toget_json_objectcalls byPullOutGenerateProjectHelper.pullOutPreProject, the generated JSON path used bare bracket notation$[key](without quotes). This works fine in Velox/simdjson, but when the expression falls back to Spark JVM execution (e.g.,get_json_objectis blacklisted or validation fails), Spark'sJsonPathParserrejects$[key]and returns NULL.This PR changes the generated path format from
$[key]to$['key'](single-quoted bracket notation), which is accepted by both Velox/simdjson and Spark JVM's JsonPathParser.Root cause:
JsonPathNormalizernormalizes$['key']→$[key]internally for simdjson, so both forms work.$.nameor$['name'], and rejects$[name](bare brackets without quotes), returning NULL directly.How was this patch tested?
Added unit tests in
MiscOperatorSuitecovering:a.b) — the core scenario for bracket notationWas this patch authored or co-authored using generative AI tooling?
Yes
Generated-by: Qoder