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

   ### Is your feature request related to a problem or challenge?
   
   Trying to create an ArrayRef from the following iterator:
   |optional_value| {
       optional_value.map(|value| 
function_that_returns_scalar(value)).unwrap_or(ScalarValue::Null)
   }
   
   Since iter_to_array does not accept a DataType, it cannot work on nullable 
lists, 
   having a null in the beginning of the iter will try and create a null array, 
meaning following values will return an exec_err, having one in the middle will 
try and create a value array and will return an error because a null was found
   
   ### Describe the solution you'd like
   
   Have the actual building logic of the iter_to_array function moved to 
another function, which accepts a datatype and nullability, and will not 
consider null values to be a breach of that datatype, unless nullability is 
false
   the iter_to_array function can maintain the peek() logic, and pass it on to 
the other function containing the build logic, with nullability set to false, 
to maintain compatibility.
   
   ### Describe alternatives you've considered
   
   _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