jacksonrnewhouse opened a new issue, #8507:
URL: https://github.com/apache/arrow-datafusion/issues/8507

   ### Describe the bug
   
   If you have table schema like 
   ```
   DFSchema {
       fields: [
           DFField {
               qualifier: Some(
                   Bare {
                       table: "nexmark",
                   },
               ),
               field: Field {
                   name: "bid",
                   data_type: Struct(
                       [
                           Field {
                               name: "auction",
                               data_type: Int64,
                               nullable: false,
                           },
                   nullable: true,
             }
   ```
   And run a query like `SELECT bid.auction FROM nexmark` you'll get an error 
when bid is null. Error looks like
   ```
   ArrowError(InvalidArgumentError("Column 'nexmark.bid[datetime]' is declared 
as non-nullable but contains null values")) 
   ```
   The problem is that the nullable() method only looks at the sub-fields 
nullability, ignoring that the parent field may be null.
   
https://github.com/apache/arrow-datafusion/blob/main/datafusion/expr/src/expr_schema.rs#L280.
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   The expression should be nullable, as its parent may not be present.
   
   ### Additional context
   
   _No response_


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

Reply via email to