ahlag opened a new pull request, #27647:
URL: https://github.com/apache/datafusion/pull/27647

   ## Which issue does this PR close?
   
   Closes #26528.
   
   ## Rationale for this change
   
   `TRY_CAST` rejects struct casts at planning time that `CAST` accepts, such 
as when the target has an additional nullable field.
   
   ## What changes are included in this PR?
   
   - Extracted the existing by-name struct check into a shared `can_plan_cast` 
helper used by both `CAST` and `TRY_CAST`.
   - Runtime behavior is unchanged, as both already cast struct fields by name 
in `ColumnarValue::cast_to`.
   - Replaces the closed #26529 with a smaller change and improved regression 
tests.
   
   ## What is the testing strategy for this PR?
   
   Added regression cases to `struct.slt` covering missing fields, failed casts 
returning NULL, lists of structs, and structs with no matching field names 
still failing at planning time.
   
   The positive cases fail on main and pass with this fix.
   
   ## Are there any user-facing changes?
   
   `TRY_CAST` now accepts additional valid struct casts. No public API changes.
   
   ## Remaining questions
   
   This also moves CAST's two inline checks into the shared helper to prevent 
the paths from drifting apart. Happy to limit the change to `TRY_CAST` if 
preferred.
   


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