You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "crepererum (via GitHub)" <gi...@apache.org> on 2023/08/18 10:05:06 UTC
[GitHub] [arrow-datafusion] crepererum commented on a diff in pull request #7313: feat: `array-empty`
crepererum commented on code in PR #7313:
URL: https://github.com/apache/arrow-datafusion/pull/7313#discussion_r1298272011
##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -986,6 +986,22 @@ macro_rules! general_repeat_list {
}};
}
+/// Array_empty SQL function
+pub fn array_empty(args: &[ArrayRef]) -> Result<ArrayRef> {
+ let array = as_list_array(&args[0])?;
+ let builder = array
+ .iter()
+ .map(|arr| {
+ if let Some(arr) = arr {
+ Some(arr.is_empty())
+ } else {
+ Some(true)
Review Comment:
Should `NULL` rather map to `NULL`? Because if you want to default `NULL` to something, you can always wrap the method with `COALESCE`.
--
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@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org