osipovartem opened a new issue, #24970:
URL: https://github.com/apache/datafusion/issues/24970

   ### 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to