You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "EmilyMatt (via GitHub)" <gi...@apache.org> on 2025/05/22 14:05:30 UTC
[I] A ScalarValue::iter_to_array with a DataType [datafusion]
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] A ScalarValue::iter_to_array with a DataType [datafusion]
Posted by "EmilyMatt (via GitHub)" <gi...@apache.org>.
EmilyMatt commented on issue #16150:
URL: https://github.com/apache/datafusion/issues/16150#issuecomment-2901485008
I've just realized my error and the level of my idiocy 🙂↔️
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] A ScalarValue::iter_to_array with a DataType [datafusion]
Posted by "EmilyMatt (via GitHub)" <gi...@apache.org>.
EmilyMatt closed issue #16150: A ScalarValue::iter_to_array with a DataType
URL: https://github.com/apache/datafusion/issues/16150
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org