N-Boutaib opened a new pull request, #20646:
URL: https://github.com/apache/datafusion/pull/20646

   ## Which issue does this PR close?
   - Closes None.
   
   ## Rationale for this change
   ensure_field_compatibility rejects Substrait plans where the base_schema 
declares a wider numeric type than the table's actual schema (e.g., Int64 in 
the plan vs Int32 in the table), even though the widening is lossless. This 
forces consumers to re-implement read_with_schema without the check or 
artificially widen types in the catalog provider.
   
   This commonly occurs when an upstream schema service normalizes all integers 
to Int64 while the native catalog preserves the original precision.
   
   ## What changes are included in this PR?
   Adds is_safe_widening to accept lossless numeric promotions (signed/unsigned 
integers, floats).
   Modifies ensure_field_compatibility to allow fields where the table type can 
be safely widened to the plan type.
   
   ## Are these changes tested?
   Yes, unit tests for `is_safe_widening` and `ensure_field_compatibility` with 
widened types.
   
   ## Are there any user-facing changes?
   No.


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