Skip to content

Commit

Permalink
Minor: fix wrong function call (apache#8847)
Browse files Browse the repository at this point in the history
* Minor: fix wrong function call

* fix array_union
  • Loading branch information
Weijun-H authored Jan 15, 2024
1 parent ff728d6 commit 6b8c6ad
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions datafusion/proto/src/logical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ use datafusion_expr::{
array_element, array_except, array_has, array_has_all, array_has_any,
array_intersect, array_length, array_ndims, array_position, array_positions,
array_prepend, array_remove, array_remove_all, array_remove_n, array_repeat,
array_replace, array_replace_all, array_replace_n, array_slice, array_sort,
array_to_string, arrow_typeof, ascii, asin, asinh, atan, atan2, atanh, bit_length,
btrim, cardinality, cbrt, ceil, character_length, chr, coalesce, concat_expr,
concat_ws_expr, cos, cosh, cot, current_date, current_time, date_bin, date_part,
date_trunc, decode, degrees, digest, encode, exp,
array_replace, array_replace_all, array_replace_n, array_resize, array_slice,
array_sort, array_to_string, array_union, arrow_typeof, ascii, asin, asinh, atan,
atan2, atanh, bit_length, btrim, cardinality, cbrt, ceil, character_length, chr,
coalesce, concat_expr, concat_ws_expr, cos, cosh, cot, current_date, current_time,
date_bin, date_part, date_trunc, decode, degrees, digest, encode, exp,
expr::{self, InList, Sort, WindowFunction},
factorial, find_in_set, flatten, floor, from_unixtime, gcd, gen_range, isnan, iszero,
lcm, left, levenshtein, ln, log, log10, log2,
Expand Down Expand Up @@ -1494,13 +1494,11 @@ pub fn parse_expr(
ScalarFunction::ArrayNdims => {
Ok(array_ndims(parse_expr(&args[0], registry)?))
}
ScalarFunction::ArrayUnion => Ok(array(
args.to_owned()
.iter()
.map(|expr| parse_expr(expr, registry))
.collect::<Result<Vec<_>, _>>()?,
ScalarFunction::ArrayUnion => Ok(array_union(
parse_expr(&args[0], registry)?,
parse_expr(&args[1], registry)?,
)),
ScalarFunction::ArrayResize => Ok(array_slice(
ScalarFunction::ArrayResize => Ok(array_resize(
parse_expr(&args[0], registry)?,
parse_expr(&args[1], registry)?,
parse_expr(&args[2], registry)?,
Expand Down

0 comments on commit 6b8c6ad

Please sign in to comment.