Skip to content

[SPARK-58643][SQL] Require a constant create_if_missing in variant_set/try_variant_set - #57855

Closed
bojana-db wants to merge 1 commit into
apache:masterfrom
bojana-db:reject-non-foldable-flag-variant-set
Closed

[SPARK-58643][SQL] Require a constant create_if_missing in variant_set/try_variant_set#57855
bojana-db wants to merge 1 commit into
apache:masterfrom
bojana-db:reject-non-foldable-flag-variant-set

Conversation

@bojana-db

@bojana-db bojana-db commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Make the optional create_if_missing argument of variant_set (and try_variant_set) a constant-only argument. VariantSet.checkInputDataTypes now rejects a non-foldable create_if_missing with DATATYPE_MISMATCH.NON_FOLDABLE_INPUT.

Why are the changes needed?

create_if_missing is a mode flag that controls the operation's behavior, not per-row data, so it should be a constant.

Does this PR introduce any user-facing change?

Yes, within the unreleased master/branch-4.x line only (variant_set/try_variant_set are new in 4.3.0 and not yet released; there is no change relative to any released Spark version).

How was this patch tested?

Unit tests.

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

Generated-by: Claude Code with Claude Opus 4.8

@uros-b

uros-b commented Aug 8, 2026

Copy link
Copy Markdown
Member

Thank you @bojana-db!

@uros-b uros-b closed this in bcd4120 Aug 8, 2026
uros-b pushed a commit that referenced this pull request Aug 8, 2026
…_set/try_variant_set`

### What changes were proposed in this pull request?
Make the optional `create_if_missing` argument of `variant_set` (and `try_variant_set`) a constant-only argument. `VariantSet.checkInputDataTypes` now rejects a non-foldable `create_if_missing` with `DATATYPE_MISMATCH.NON_FOLDABLE_INPUT`.

### Why are the changes needed?
`create_if_missing` is a mode flag that controls the operation's behavior, not per-row data, so it should be a constant.

### Does this PR introduce _any_ user-facing change?
Yes, within the unreleased `master`/`branch-4.x` line only (`variant_set`/`try_variant_set` are new in 4.3.0 and not yet released; there is no change relative to any released Spark version).

### How was this patch tested?
Unit tests.

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code with Claude Opus 4.8

Closes #57855 from bojana-db/reject-non-foldable-flag-variant-set.

Authored-by: bojana-db <bojana.zecevic@databricks.com>
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>
(cherry picked from commit bcd4120)
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>
uros-b pushed a commit that referenced this pull request Aug 8, 2026
…_set/try_variant_set`

### What changes were proposed in this pull request?
Make the optional `create_if_missing` argument of `variant_set` (and `try_variant_set`) a constant-only argument. `VariantSet.checkInputDataTypes` now rejects a non-foldable `create_if_missing` with `DATATYPE_MISMATCH.NON_FOLDABLE_INPUT`.

### Why are the changes needed?
`create_if_missing` is a mode flag that controls the operation's behavior, not per-row data, so it should be a constant.

### Does this PR introduce _any_ user-facing change?
Yes, within the unreleased `master`/`branch-4.x` line only (`variant_set`/`try_variant_set` are new in 4.3.0 and not yet released; there is no change relative to any released Spark version).

### How was this patch tested?
Unit tests.

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code with Claude Opus 4.8

Closes #57855 from bojana-db/reject-non-foldable-flag-variant-set.

Authored-by: bojana-db <bojana.zecevic@databricks.com>
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>
(cherry picked from commit bcd4120)
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>
@uros-b

uros-b commented Aug 8, 2026

Copy link
Copy Markdown
Member

Merge Summary:

Posted by merge_spark_pr.py

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