Skip to content

Commit

Permalink
support NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Aug 22, 2023
1 parent 8df5ba2 commit c6f5144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion datafusion/physical-expr/src/array_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ macro_rules! general_repeat_list {

/// Array_empty SQL function
pub fn array_empty(args: &[ArrayRef]) -> Result<ArrayRef> {
println!("args[0]: {:?}", &args[0]);
if args[0].as_any().downcast_ref::<NullArray>().is_some() {
return Ok(args[0].clone());
}
Expand All @@ -999,7 +1000,7 @@ pub fn array_empty(args: &[ArrayRef]) -> Result<ArrayRef> {
if let Some(arr) = arr {
Some(arr.len() == arr.null_count())
} else {
Some(true)
None
}
})
.collect::<BooleanArray>();
Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ false
false
false
false
true
NULL
false
false

Expand Down

0 comments on commit c6f5144

Please sign in to comment.