Skip to content

Commit 3846b70

Browse files
committed
fix proto
Signed-off-by: jayzhan211 <[email protected]>
1 parent 0b700c6 commit 3846b70

File tree

6 files changed

+30
-7
lines changed

6 files changed

+30
-7
lines changed

datafusion/expr/src/expr_fn.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,12 @@ scalar_expr!(
620620
array element,
621621
"extracts the element with the index n from the array."
622622
);
623+
scalar_expr!(
624+
ArrayExcept,
625+
array_except,
626+
first_array second_array,
627+
"Returns an array of the elements that appear in the first array but not in the second."
628+
);
623629
scalar_expr!(
624630
ArrayLength,
625631
array_length,

datafusion/proto/proto/datafusion.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ enum ScalarFunction {
622622
StringToArray = 117;
623623
ToTimestampNanos = 118;
624624
ArrayIntersect = 119;
625+
ArrayExcept = 120;
625626
}
626627

627628
message ScalarFunctionNode {

datafusion/proto/src/generated/pbjson.rs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/generated/prost.rs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/logical_plan/from_proto.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ use datafusion_common::{
4040
};
4141
use datafusion_expr::{
4242
abs, acos, acosh, array, array_append, array_concat, array_dims, array_element,
43-
array_has, array_has_all, array_has_any, array_length, array_ndims, array_position,
44-
array_positions, array_prepend, array_remove, array_remove_all, array_remove_n,
45-
array_repeat, array_replace, array_replace_all, array_replace_n, array_slice,
46-
array_to_string, arrow_typeof, ascii, asin, asinh, atan, atan2, atanh, bit_length,
47-
btrim, cardinality, cbrt, ceil, character_length, chr, coalesce, concat_expr,
48-
concat_ws_expr, cos, cosh, cot, current_date, current_time, date_bin, date_part,
49-
date_trunc, decode, degrees, digest, encode, exp,
43+
array_except, array_has, array_has_all, array_has_any, array_intersect, array_length,
44+
array_ndims, array_position, array_positions, array_prepend, array_remove,
45+
array_remove_all, array_remove_n, array_repeat, array_replace, array_replace_all,
46+
array_replace_n, array_slice, array_to_string, arrow_typeof, ascii, asin, asinh,
47+
atan, atan2, atanh, bit_length, btrim, cardinality, cbrt, ceil, character_length,
48+
chr, coalesce, concat_expr, concat_ws_expr, cos, cosh, cot, current_date,
49+
current_time, date_bin, date_part, date_trunc, decode, degrees, digest, encode, exp,
5050
expr::{self, InList, Sort, WindowFunction},
5151
factorial, flatten, floor, from_unixtime, gcd, isnan, iszero, lcm, left, ln, log,
5252
log10, log2,
@@ -462,6 +462,7 @@ impl From<&protobuf::ScalarFunction> for BuiltinScalarFunction {
462462
ScalarFunction::ArrayAppend => Self::ArrayAppend,
463463
ScalarFunction::ArrayConcat => Self::ArrayConcat,
464464
ScalarFunction::ArrayEmpty => Self::ArrayEmpty,
465+
ScalarFunction::ArrayExcept => Self::ArrayExcept,
465466
ScalarFunction::ArrayHasAll => Self::ArrayHasAll,
466467
ScalarFunction::ArrayHasAny => Self::ArrayHasAny,
467468
ScalarFunction::ArrayHas => Self::ArrayHas,
@@ -1330,6 +1331,10 @@ pub fn parse_expr(
13301331
.map(|expr| parse_expr(expr, registry))
13311332
.collect::<Result<Vec<_>, _>>()?,
13321333
)),
1334+
ScalarFunction::ArrayExcept => Ok(array_except(
1335+
parse_expr(&args[0], registry)?,
1336+
parse_expr(&args[1], registry)?,
1337+
)),
13331338
ScalarFunction::ArrayHasAll => Ok(array_has_all(
13341339
parse_expr(&args[0], registry)?,
13351340
parse_expr(&args[1], registry)?,
@@ -1342,6 +1347,10 @@ pub fn parse_expr(
13421347
parse_expr(&args[0], registry)?,
13431348
parse_expr(&args[1], registry)?,
13441349
)),
1350+
ScalarFunction::ArrayIntersect => Ok(array_intersect(
1351+
parse_expr(&args[0], registry)?,
1352+
parse_expr(&args[1], registry)?,
1353+
)),
13451354
ScalarFunction::ArrayPosition => Ok(array_position(
13461355
parse_expr(&args[0], registry)?,
13471356
parse_expr(&args[1], registry)?,

datafusion/proto/src/logical_plan/to_proto.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ impl TryFrom<&BuiltinScalarFunction> for protobuf::ScalarFunction {
14601460
BuiltinScalarFunction::ArrayAppend => Self::ArrayAppend,
14611461
BuiltinScalarFunction::ArrayConcat => Self::ArrayConcat,
14621462
BuiltinScalarFunction::ArrayEmpty => Self::ArrayEmpty,
1463+
BuiltinScalarFunction::ArrayExcept => Self::ArrayExcept,
14631464
BuiltinScalarFunction::ArrayHasAll => Self::ArrayHasAll,
14641465
BuiltinScalarFunction::ArrayHasAny => Self::ArrayHasAny,
14651466
BuiltinScalarFunction::ArrayHas => Self::ArrayHas,

0 commit comments

Comments
 (0)