mkleen commented on PR #22730:
URL: https://github.com/apache/datafusion/pull/22730#issuecomment-4657239393

   @Jefffrey The List cast fails at runtime when a null-value is included:
   
   ```
   >  select arrow_cast([1, null], 'List(non-null Int64)');
   Optimizer rule 'simplify_expressions' failed
   caused by
   Arrow error: Invalid argument error: Non-nullable field of ListArray "item" 
cannot contain nulls
   ```
   
   If we want to align the behavior of Lists and Structs here I see two options:
   
   - Forbid on type-system level to cast nullable Lists to non-nullable Lists.
   - Allow the cast of nullable Struct fields to non-nullable fields on 
type-system level and throw an error at runtime when there is an actual null 
value.
   
   WDYT?


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