Skip to content

Preserve OBJECT type for bound NULL in INSERT VALUES - #156

Merged
osipovartem merged 1 commit into
df55-array-insert-coercionfrom
df55-bound-null-object-values
Oct 20, 2026
Merged

osipovartem merged 1 commit into
df55-array-insert-coercionfrom
df55-bound-null-object-values

Conversation

@osipovartem

@osipovartem osipovartem commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve a typed NULL for an OBJECT-typed placeholder when DataFusion substitutes query parameters.
  • Keep the existing rejection of non-NULL scalar bindings into OBJECT.
  • Assert the bound VALUES plan retains an Utf8 input field rather than falling back to Null.

Why

Rustice REST wire test connector_object_bindings_reject_scalars_and_accept_null reached the Iceberg sink with a physical Null VALUES field for INSERT INTO t(payload OBJECT) VALUES (:1) when :1 was bound as ANY = NULL; the sink rejected the schema. DataFusion's replace_params_with_values rebuilds VALUES after substitution. The target field has OBJECT metadata and Utf8 storage, but ScalarValue::Null loses that physical type.

The stock Snowflake Python Connector qmark-bound None inserted successfully into a temporary OBJECT column (1 row, 0 non-NULL payloads) in a focused live check. The oracle warehouse was suspended afterward.

Verification

  • cargo +1.97.0 fmt --all -- --check
  • cargo +1.97.0 test --profile ci -p datafusion-sql --test sql_integration: 642/642
  • cargo +1.97.0 clippy --profile ci -p datafusion-expr -p datafusion-sql --all-targets -- -D warnings
  • Rustice REST wire test connector_object_bindings_reject_scalars_and_accept_null on rev 8572b31fce6007348fcd5037cc515a0e7f3e472a: 1/1 passed through the local REST endpoint and Iceberg sink (loopback bind required an unsandboxed test run).
  • Independent read-only review approved the diff with no blockers; it specifically requested this physical REST verification, now complete.

This is a narrow follow-up to #155. It does not change the common non-NULL parameter path.

@osipovartem
osipovartem marked this pull request as ready for review October 20, 2026 23:06
@osipovartem
osipovartem merged commit d9895a7 into df55-array-insert-coercion Oct 20, 2026
33 of 38 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