@@ -43,19 +43,20 @@ use datafusion_expr::{
43
43
array_has, array_has_all, array_has_any, array_length, array_ndims, array_position,
44
44
array_positions, array_prepend, array_remove, array_remove_all, array_remove_n,
45
45
array_repeat, array_replace, array_replace_all, array_replace_n, array_slice,
46
- array_to_string, ascii, asin, asinh, atan, atan2, atanh, bit_length, btrim ,
47
- cardinality, cbrt, ceil, character_length, chr, coalesce, concat_expr,
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
48
concat_ws_expr, cos, cosh, cot, current_date, current_time, date_bin, date_part,
49
49
date_trunc, decode, degrees, digest, encode, exp,
50
50
expr:: { self , InList , Sort , WindowFunction } ,
51
- factorial, floor, from_unixtime, gcd, isnan, iszero, lcm, left, ln, log, log10, log2,
51
+ factorial, flatten, floor, from_unixtime, gcd, isnan, iszero, lcm, left, ln, log,
52
+ log10, log2,
52
53
logical_plan:: { PlanType , StringifiedPlan } ,
53
54
lower, lpad, ltrim, md5, nanvl, now, nullif, octet_length, pi, power, radians,
54
55
random, regexp_match, regexp_replace, repeat, replace, reverse, right, round, rpad,
55
56
rtrim, sha224, sha256, sha384, sha512, signum, sin, sinh, split_part, sqrt,
56
- starts_with, strpos, substr, substring, tan, tanh, to_hex , to_timestamp_micros ,
57
- to_timestamp_millis , to_timestamp_nanos , to_timestamp_seconds , translate , trim ,
58
- trunc, upper, uuid,
57
+ starts_with, string_to_array , strpos, struct_fun , substr, substring, tan, tanh,
58
+ to_hex , to_timestamp_micros , to_timestamp_millis , to_timestamp_nanos ,
59
+ to_timestamp_seconds , translate , trim , trunc, upper, uuid,
59
60
window_frame:: regularize,
60
61
AggregateFunction , Between , BinaryExpr , BuiltInWindowFunction , BuiltinScalarFunction ,
61
62
Case , Cast , Expr , GetFieldAccess , GetIndexedField , GroupingSet ,
@@ -1645,9 +1646,21 @@ pub fn parse_expr(
1645
1646
) ) ,
1646
1647
ScalarFunction :: Isnan => Ok ( isnan ( parse_expr ( & args[ 0 ] , registry) ?) ) ,
1647
1648
ScalarFunction :: Iszero => Ok ( iszero ( parse_expr ( & args[ 0 ] , registry) ?) ) ,
1648
- _ => Err ( proto_error (
1649
- "Protobuf deserialization error: Unsupported scalar function" ,
1649
+ ScalarFunction :: ArrowTypeof => {
1650
+ Ok ( arrow_typeof ( parse_expr ( & args[ 0 ] , registry) ?) )
1651
+ }
1652
+ ScalarFunction :: ToTimestamp => {
1653
+ Ok ( to_timestamp_seconds ( parse_expr ( & args[ 0 ] , registry) ?) )
1654
+ }
1655
+ ScalarFunction :: Flatten => Ok ( flatten ( parse_expr ( & args[ 0 ] , registry) ?) ) ,
1656
+ ScalarFunction :: StringToArray => Ok ( string_to_array (
1657
+ parse_expr ( & args[ 0 ] , registry) ?,
1658
+ parse_expr ( & args[ 1 ] , registry) ?,
1659
+ parse_expr ( & args[ 2 ] , registry) ?,
1650
1660
) ) ,
1661
+ ScalarFunction :: StructFun => {
1662
+ Ok ( struct_fun ( parse_expr ( & args[ 0 ] , registry) ?) )
1663
+ }
1651
1664
}
1652
1665
}
1653
1666
ExprType :: ScalarUdfExpr ( protobuf:: ScalarUdfExprNode { fun_name, args } ) => {
0 commit comments