Jefffrey opened a new issue, #17817:
URL: https://github.com/apache/datafusion/issues/17817

   ### Describe the bug
   
   Given this test:
   
   ```rust
       #[test]
       fn test_array_has() -> Result<(), DataFusionError> {
           let haystack_field = Arc::new(Field::new_list(
               "haystack",
               Field::new_list("", Field::new("", DataType::Int32, true), true),
               true,
           ));
           let needle_field = Arc::new(Field::new_list(
               "needle",
               Field::new("", DataType::Int32, true),
               true,
           ));
           let return_field = Arc::new(Field::new_list(
               "return",
               Field::new("", DataType::Boolean, true),
               true,
           ));
   
           let haystack = ListArray::new(
               Field::new_list_field(DataType::Int32, true).into(),
               OffsetBuffer::new(vec![0, 0].into()),
               Arc::new(Int32Array::from(Vec::<i32>::new())) as ArrayRef,
               Some(vec![false].into()),
           );
   
           let haystack = ColumnarValue::Array(Arc::new(haystack));
           let needle = ColumnarValue::Scalar(ScalarValue::Int32(Some(1)));
   
           let result = ArrayHas::new().invoke_with_args(ScalarFunctionArgs {
               args: vec![haystack, needle],
               arg_fields: vec![Arc::clone(&haystack_field), 
Arc::clone(&needle_field)],
               number_rows: 1,
               return_field: Arc::clone(&return_field),
               config_options: Arc::new(ConfigOptions::default()),
           })?;
   
           dbg!(result);
   
           Ok(())
       }
   ```
   
   The output is an array `[false]` which is incorrect, it should be `[null]` 
since the haystack input here is a list with a single null element.
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to