tustvold commented on issue #7119:
URL: https://github.com/apache/arrow-rs/issues/7119#issuecomment-2654025232

   I think the code should be relatively straightforward
   
   ```
   fn project(a: &StructArray, idx: usize) -> Result<ArrayRef, ArrowError> {
       match a.nulls() {
           Some(x) => nullif(a.column(idx), &BooleanArray::new(x.inner().not(), 
None)),
           None => Ok(a.column(idx).clone()),
       }
   }
   ```
   
   I think adding a kernel to union nulls as described in 
https://github.com/apache/arrow-rs/issues/6528 would simplify this down to
   
   ```
   fn project(a: &StructArray, idx: usize) -> Result<ArrayRef, ArrowError> {
       nullify(a.column(idx), a.nulls())
   }
   
   fn nullify(a: &dyn Array, nulls: Option<&NullBuffer>) -> ArrayRef {
       ...
   }
   ```


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to