Skip to content

feat: add opt-in VALUES column metadata resolution - #181

Merged
Vedin merged 1 commit into
df55-physical-udf-instancefrom
oracle/qualify-values-metadata-resolution-20261107
Nov 7, 2026
Merged

Vedin merged 1 commit into
df55-physical-udf-instancefrom
oracle/qualify-values-metadata-resolution-20261107

Conversation

@Vedin

@Vedin Vedin commented Nov 7, 2026

Copy link
Copy Markdown

Which issue does this PR close?

No standalone issue. Downstream integration reference: Embucket/rustice#1190.

Rationale for this change

A SQL client cannot currently reconcile domain-specific field metadata in VALUES. Mixing a string literal with a width-annotated typed NULL fails during planning, before functions such as NEXT_DAY can run. Clients need an opt-in policy that preserves the declared metadata.

What changes are included in this PR?

Add a default-declining TypePlanner hook and a logical-builder resolver, called once per conflicting column with borrowed input rows. Default strict errors, equal-metadata fast paths, target-schema VALUES, CASE, type coercion and nullability remain unchanged. No product-specific width policy is embedded in DataFusion.

Are these changes tested?

Builder tests cover complete-column borrowing, one call per conflicting column, equal-metadata bypass, declined resolution and errors, plus SQL-to-TypePlanner integration.

Validated locally on Rust 1.97.0: formatting, Prettier, strict all-target/all-feature Clippy, the unmodified full dev/rust_lint.sh, and an expr check without default features pass. The extended workspace graph passes across 73 test executables: 10,767 native tests, 10 existing ignored, and all 509 SQL logic files.

An IDE OOM interrupted the initial run. Exact fresh Cargo artifacts/source identities were reconciled; the completed 115-test generated-input fuzz executable was retained, and all 72 other executables were rerun after restoring relative fixture paths to the pinned Arrow/Parquet data. No test expectations changed. The final reruns used one test thread under an 8 GiB memory cap.

Are there any user-facing changes?

Additive public APIs: ValuesMetadataResolver, LogicalPlanBuilder::values_with_metadata_resolver and TypePlanner::plan_values_column_metadata. The trait method has a default implementation. Existing callers retain strict behavior unless they opt in.

@Vedin
Vedin merged commit 3c83a9f into df55-physical-udf-instance Nov 7, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant