Skip to content

[spark] Reject variant extraction paths containing the metadata delimiter - #9569

Merged
JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:variant-path-delimiter-guard
Sep 4, 2026
Merged

[spark] Reject variant extraction paths containing the metadata delimiter#9569
JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:variant-path-delimiter-guard

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

A variant extraction path is encoded into the projected field's description as __VARIANT_METADATA<path>;<failOnError>;<timeZoneId> and split back on ; with no escaping. VariantPathSegment allows ; in a key, so $.a;b decodes as path $.a with failOnError=false and ZoneId.of("true"), while $.a;true;UTC re-splits into a valid triple and reads a different field.

Skip the pushdown for such paths, and assert the invariant in the encoder. The MAP selected-keys path already pairs the same two guards on this delimiter.

Tests

VariantMetadataUtilsTest, VariantPushDownUtilsTest.

Written with Claude Code; reasoning and verification are mine.

…iter

The extraction path is encoded into the field description and split back
on ";" with no escaping, so a path carrying the delimiter decodes into a
different path. Skip the pushdown for such paths and assert the
invariant in the encoder, mirroring the MAP selected-keys guards.
@jackylee-ch
jackylee-ch force-pushed the variant-path-delimiter-guard branch from 3548c33 to ecb29b0 Compare September 4, 2026 04:55
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 70d98e5 into apache:master Sep 4, 2026
14 checks passed
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.

2 participants