Skip to content

INSERT can drop target Arrow extension metadata #24970

Description

@osipovartem

Bug

When an INSERT source column has the same Arrow storage DataType as the target column but the target has Arrow extension metadata, SQL planning skips the cast because it compares only DataType. The resulting DML projection therefore has the source field metadata instead of the target table field metadata.

For example, inserting an unannotated FixedSizeBinary(16) column into an arrow.uuid column produces a projection without the UUID extension marker. This can also affect other extension types represented by field metadata.

Expected behavior

The DML projection should enforce the target column metadata, including Arrow extension metadata, even when source and target storage types are identical.

Additional context

Cast and CastExpr already support full target Field semantics. The INSERT planner currently calls cast_to(target_field.data_type(), ...), which only enforces the storage type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions