Apache DataFusion SQL Query Engine
Support more ScalarFunction in Ballista (#2008)
Yang Jiangdbc58152b05b
diff --git a/ballista/rust/core/proto/datafusion.proto b/ballista/rust/core/proto/datafusion.protoindex f1a0730644..85b86e220c 100644--- a/ballista/rust/core/proto/datafusion.proto+++ b/ballista/rust/core/proto/datafusion.proto@@ -113,43 +113,69 @@ message InListNode {}enum ScalarFunction {- SQRT = 0;- SIN = 1;- COS = 2;- TAN = 3;- ASIN = 4;- ACOS = 5;- ATAN = 6;- EXP = 7;- LOG = 8;- LOG2 = 9;- LOG10 = 10;- FLOOR = 11;- CEIL = 12;- ROUND = 13;- TRUNC = 14;- ABS = 15;- SIGNUM = 16;- OCTETLENGTH = 17;- CONCAT = 18;- LOWER = 19;- UPPER = 20;- TRIM = 21;- LTRIM = 22;- RTRIM = 23;- TOTIMESTAMP = 24;- ARRAY = 25;- NULLIF = 26;- DATEPART = 27;- DATETRUNC = 28;- MD5 = 29;- SHA224 = 30;- SHA256 = 31;- SHA384 = 32;- SHA512 = 33;- LN = 34;- TOTIMESTAMPMILLIS = 35;- DIGEST = 36;+ Abs=0;+ Acos=1;+ Asin=2;+ Atan=3;+ Ascii=4;+ Ceil=5;+ Cos=6;+ Digest=7;+ Exp=8;+ Floor=9;+ Ln=10;+ Log=11;+ Log10=12;+ Log2=13;+ Round=14;+ Signum=15;+ Sin=16;+ Sqrt=17;+ Tan=18;+ Trunc=19;+ Array=20;+ RegexpMatch=21;+ BitLength=22;+ Btrim=23;+ CharacterLength=24;+ Chr=25;+ Concat=26;+ ConcatWithSeparator=27;+ DatePart=28;+ DateTrunc=29;+ InitCap=30;+ Left=31;+ Lpad=32;+ Lower=33;+ Ltrim=34;+ MD5=35;+ NullIf=36;+ OctetLength=37;+ Random=38;+ RegexpReplace=39;+ Repeat=40;+ Replace=41;+ Reverse=42;+ Right=43;+ Rpad=44;+ Rtrim=45;+ SHA224=46;+ SHA256=47;+ SHA384=48;+ SHA512=49;+ SplitPart=50;+ StartsWith=51;+ Strpos=52;+ Substr=53;+ ToHex=54;+ ToTimestamp=55;+ ToTimestampMillis=56;+ ToTimestampMicros=57;+ ToTimestampSeconds=58;+ Now=59;+ Translate=60;+ Trim=61;+ Upper=62;}message ScalarFunctionNode {diff --git a/datafusion-expr/src/expr_fn.rs b/datafusion-expr/src/expr_fn.rsindex d39269cca0..a5c302c5f6 100644--- a/datafusion-expr/src/expr_fn.rs+++ b/datafusion-expr/src/expr_fn.rs@@ -226,11 +226,11 @@ unary_scalar_expr!(Exp, exp);unary_scalar_expr!(Log2, log2);unary_scalar_expr!(Log10, log10);unary_scalar_expr!(Ln, ln);+unary_scalar_expr!(NullIf, nullif);// string functionsscalar_expr!(Ascii, ascii, string);scalar_expr!(BitLength, bit_length, string);-nary_scalar_expr!(Btrim, btrim);scalar_expr!(CharacterLength, character_length, string);scalar_expr!(CharacterLength, length, string);scalar_expr!(Chr, chr, string);@@ -238,17 +238,13 @@ scalar_expr!(Digest, digest, string, algorithm);scalar_expr!(InitCap, initcap, string);scalar_expr!(Left, left, string, count);scalar_expr!(Lower, lower, string);-nary_scalar_expr!(Lpad, lpad);scalar_expr!(Ltrim, ltrim, string);scalar_expr!(MD5, md5, string);scalar_expr!(OctetLength, octet_length, string);-nary_scalar_expr!(RegexpMatch, regexp_match);-nary_scalar_expr!(RegexpReplace, regexp_replace);scalar_expr!(Replace, replace, string, from, to);scalar_expr!(Repeat, repeat, string, count);scalar_expr!(Reverse, reverse, string);scalar_expr!(Right, right, string, count);-nary_scalar_expr!(Rpad, rpad);scalar_expr!(Rtrim, rtrim, string);scalar_expr!(SHA224, sha224, string);scalar_expr!(SHA256, sha256, string);@@ -262,10 +258,23 @@ scalar_expr!(ToHex, to_hex, string);scalar_expr!(Translate, translate, string, from, to);scalar_expr!(Trim, trim, string);scalar_expr!(Upper, upper, string);+//use vec as parameter+nary_scalar_expr!(Lpad, lpad);+nary_scalar_expr!(Rpad, rpad);+nary_scalar_expr!(RegexpReplace, regexp_replace);+nary_scalar_expr!(RegexpMatch, regexp_match);+nary_scalar_expr!(Btrim, btrim);+//there is a func concat_ws before, so use concat_ws_expr as name.c+nary_scalar_expr!(ConcatWithSeparator, concat_ws_expr);+nary_scalar_expr!(Concat, concat_expr);+nary_scalar_expr!(Now, now_expr);// date functionsscalar_expr!(DatePart, date_part, part, date);scalar_expr!(DateTrunc, date_trunc, part, date);+scalar_expr!(ToTimestampMillis, to_timestamp_millis, date);+scalar_expr!(ToTimestampMicros, to_timestamp_micros, date);+scalar_expr!(ToTimestampSeconds, to_timestamp_seconds, date);/// Returns an array of fixed size with each argument on it.pub fn array(args: Vec<Expr>) -> Expr {diff --git a/datafusion-proto/proto/datafusion.proto b/datafusion-proto/proto/datafusion.protoindex 0aa9b1a782..a0c5c2f1f9 100644--- a/datafusion-proto/proto/datafusion.proto+++ b/datafusion-proto/proto/datafusion.proto@@ -114,43 +114,69 @@ message InListNode {}enum ScalarFunction {- SQRT = 0;- SIN = 1;- COS = 2;- TAN = 3;- ASIN = 4;- ACOS = 5;- ATAN = 6;- EXP = 7;- LOG = 8;- LOG2 = 9;- LOG10 = 10;- FLOOR = 11;- CEIL = 12;- ROUND = 13;- TRUNC = 14;- ABS = 15;- SIGNUM = 16;- OCTETLENGTH = 17;- CONCAT = 18;- LOWER = 19;- UPPER = 20;- TRIM = 21;- LTRIM = 22;- RTRIM = 23;- TOTIMESTAMP = 24;- ARRAY = 25;- NULLIF = 26;- DATEPART = 27;- DATETRUNC = 28;- MD5 = 29;- SHA224 = 30;- SHA256 = 31;- SHA384 = 32;- SHA512 = 33;- LN = 34;- TOTIMESTAMPMILLIS = 35;- DIGEST = 36;+ Abs=0;+ Acos=1;+ Asin=2;+ Atan=3;+ Ascii=4;+ Ceil=5;+ Cos=6;+ Digest=7;+ Exp=8;+ Floor=9;+ Ln=10;+ Log=11;+ Log10=12;+ Log2=13;+ Round=14;+ Signum=15;+ Sin=16;+ Sqrt=17;+ Tan=18;+ Trunc=19;+ Array=20;+ RegexpMatch=21;+ BitLength=22;+ Btrim=23;+ CharacterLength=24;+ Chr=25;+ Concat=26;+ ConcatWithSeparator=27;+ DatePart=28;+ DateTrunc=29;+ InitCap=30;+ Left=31;+ Lpad=32;+ Lower=33;+ Ltrim=34;+ MD5=35;+ NullIf=36;+ OctetLength=37;+ Random=38;+ RegexpReplace=39;+ Repeat=40;+ Replace=41;+ Reverse=42;+ Right=43;+ Rpad=44;+ Rtrim=45;+ SHA224=46;+ SHA256=47;+ SHA384=48;+ SHA512=49;+ SplitPart=50;+ StartsWith=51;+ Strpos=52;+ Substr=53;+ ToHex=54;+ ToTimestamp=55;+ ToTimestampMillis=56;+ ToTimestampMicros=57;+ ToTimestampSeconds=58;+ Now=59;+ Translate=60;+ Trim=61;+ Upper=62;}message ScalarFunctionNode {diff --git a/datafusion-proto/src/from_proto.rs b/datafusion-proto/src/from_proto.rsindex 8b9041df2e..e7a5def7b8 100644--- a/datafusion-proto/src/from_proto.rs+++ b/datafusion-proto/src/from_proto.rs@@ -20,8 +20,11 @@ use datafusion::{arrow::datatypes::{DataType, Field, IntervalUnit, Schema, TimeUnit, UnionMode},error::DataFusionError,logical_plan::{- abs, atan, ceil, cos, digest, exp, floor, ln, log10, log2, round, signum, sin,- sqrt, tan, trunc,+ abs, acos, ascii, asin, atan, ceil, character_length, chr, concat_expr,+ concat_ws_expr, cos, digest, exp, floor, left, ln, log10, log2, now_expr, nullif,+ random, regexp_replace, repeat, replace, reverse, right, round, signum, sin,+ split_part, sqrt, starts_with, strpos, substr, tan, to_hex, to_timestamp_micros,+ to_timestamp_millis, to_timestamp_seconds, translate, trunc,window_frames::{WindowFrame, WindowFrameBound, WindowFrameUnits},Column, DFField, DFSchema, DFSchemaRef, Expr, Operator,},@@ -30,8 +33,8 @@ use datafusion::{window_functions::BuiltInWindowFunction,},prelude::{- date_part, date_trunc, lower, ltrim, octet_length, rtrim, sha224, sha256, sha384,- sha512, trim, upper,+ array, btrim, date_part, date_trunc, lower, lpad, ltrim, md5, octet_length,+ regexp_match, rpad, rtrim, sha224, sha256, sha384, sha512, trim, upper,},scalar::ScalarValue,};@@ -370,34 +373,60 @@ impl From<&protobuf::ScalarFunction> for BuiltinScalarFunction {ScalarFunction::Atan => Self::Atan,ScalarFunction::Exp => Self::Exp,ScalarFunction::Log => Self::Log,- ScalarFunction::Log2 => Self::Log2,+ ScalarFunction::Ln => Self::Ln,ScalarFunction::Log10 => Self::Log10,ScalarFunction::Floor => Self::Floor,ScalarFunction::Ceil => Self::Ceil,ScalarFunction::Round => Self::Round,ScalarFunction::Trunc => Self::Trunc,ScalarFunction::Abs => Self::Abs,- ScalarFunction::Signum => Self::Signum,- ScalarFunction::Octetlength => Self::OctetLength,+ ScalarFunction::OctetLength => Self::OctetLength,ScalarFunction::Concat => Self::Concat,ScalarFunction::Lower => Self::Lower,ScalarFunction::Upper => Self::Upper,ScalarFunction::Trim => Self::Trim,ScalarFunction::Ltrim => Self::Ltrim,ScalarFunction::Rtrim => Self::Rtrim,- ScalarFunction::Totimestamp => Self::ToTimestamp,+ ScalarFunction::ToTimestamp => Self::ToTimestamp,ScalarFunction::Array => Self::Array,- ScalarFunction::Nullif => Self::NullIf,- ScalarFunction::Datepart => Self::DatePart,- ScalarFunction::Datetrunc => Self::DateTrunc,+ ScalarFunction::NullIf => Self::NullIf,+ ScalarFunction::DatePart => Self::DatePart,+ ScalarFunction::DateTrunc => Self::DateTrunc,ScalarFunction::Md5 => Self::MD5,ScalarFunction::Sha224 => Self::SHA224,ScalarFunction::Sha256 => Self::SHA256,ScalarFunction::Sha384 => Self::SHA384,ScalarFunction::Sha512 => Self::SHA512,ScalarFunction::Digest => Self::Digest,- ScalarFunction::Ln => Self::Ln,- ScalarFunction::Totimestampmillis => Self::ToTimestampMillis,+ ScalarFunction::ToTimestampMillis => Self::ToTimestampMillis,+ ScalarFunction::Log2 => Self::Log2,+ ScalarFunction::Signum => Self::Signum,+ ScalarFunction::Ascii => Self::Ascii,+ ScalarFunction::BitLength => Self::BitLength,+ ScalarFunction::Btrim => Self::Btrim,+ ScalarFunction::CharacterLength => Self::CharacterLength,+ ScalarFunction::Chr => Self::Chr,+ ScalarFunction::ConcatWithSeparator => Self::ConcatWithSeparator,+ ScalarFunction::InitCap => Self::InitCap,+ ScalarFunction::Left => Self::Left,+ ScalarFunction::Lpad => Self::Lpad,+ ScalarFunction::Random => Self::Random,+ ScalarFunction::RegexpReplace => Self::RegexpReplace,+ ScalarFunction::Repeat => Self::Repeat,+ ScalarFunction::Replace => Self::Replace,+ ScalarFunction::Reverse => Self::Reverse,+ ScalarFunction::Right => Self::Right,+ ScalarFunction::Rpad => Self::Rpad,+ ScalarFunction::SplitPart => Self::SplitPart,+ ScalarFunction::StartsWith => Self::StartsWith,+ ScalarFunction::Strpos => Self::Strpos,+ ScalarFunction::Substr => Self::Substr,+ ScalarFunction::ToHex => Self::ToHex,+ ScalarFunction::ToTimestampMicros => Self::ToTimestampMicros,+ ScalarFunction::ToTimestampSeconds => Self::ToTimestampSeconds,+ ScalarFunction::Now => Self::Now,+ ScalarFunction::Translate => Self::Translate,+ ScalarFunction::RegexpMatch => Self::RegexpMatch,}}}@@ -976,12 +1005,18 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {let args = &expr.args;match scalar_function {+ ScalarFunction::Asin => Ok(asin((&args[0]).try_into()?)),+ ScalarFunction::Acos => Ok(acos((&args[0]).try_into()?)),+ ScalarFunction::Array => Ok(array(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),ScalarFunction::Sqrt => Ok(sqrt((&args[0]).try_into()?)),ScalarFunction::Sin => Ok(sin((&args[0]).try_into()?)),ScalarFunction::Cos => Ok(cos((&args[0]).try_into()?)),ScalarFunction::Tan => Ok(tan((&args[0]).try_into()?)),- // ScalarFunction::Asin => Ok(asin(&args[0]).try_into()?)),- // ScalarFunction::Acos => Ok(acos(&args[0]).try_into()?)),ScalarFunction::Atan => Ok(atan((&args[0]).try_into()?)),ScalarFunction::Exp => Ok(exp((&args[0]).try_into()?)),ScalarFunction::Log2 => Ok(log2((&args[0]).try_into()?)),@@ -993,32 +1028,129 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {ScalarFunction::Trunc => Ok(trunc((&args[0]).try_into()?)),ScalarFunction::Abs => Ok(abs((&args[0]).try_into()?)),ScalarFunction::Signum => Ok(signum((&args[0]).try_into()?)),- ScalarFunction::Octetlength => {+ ScalarFunction::OctetLength => {Ok(octet_length((&args[0]).try_into()?))}- // // ScalarFunction::Concat => Ok(concat((&args[0]).try_into()?)),ScalarFunction::Lower => Ok(lower((&args[0]).try_into()?)),ScalarFunction::Upper => Ok(upper((&args[0]).try_into()?)),ScalarFunction::Trim => Ok(trim((&args[0]).try_into()?)),ScalarFunction::Ltrim => Ok(ltrim((&args[0]).try_into()?)),ScalarFunction::Rtrim => Ok(rtrim((&args[0]).try_into()?)),- // ScalarFunction::Totimestamp => Ok(to_timestamp((&args[0]).try_into()?)),- // ScalarFunction::Array => Ok(array((&args[0]).try_into()?)),- // // ScalarFunction::Nullif => Ok(nulli((&args[0]).try_into()?)),- ScalarFunction::Datepart => {+ ScalarFunction::DatePart => {Ok(date_part((&args[0]).try_into()?, (&args[1]).try_into()?))}- ScalarFunction::Datetrunc => {+ ScalarFunction::DateTrunc => {Ok(date_trunc((&args[0]).try_into()?, (&args[1]).try_into()?))}- // ScalarFunction::Md5 => Ok(md5((&args[0]).try_into()?)),ScalarFunction::Sha224 => Ok(sha224((&args[0]).try_into()?)),ScalarFunction::Sha256 => Ok(sha256((&args[0]).try_into()?)),ScalarFunction::Sha384 => Ok(sha384((&args[0]).try_into()?)),ScalarFunction::Sha512 => Ok(sha512((&args[0]).try_into()?)),+ ScalarFunction::Md5 => Ok(md5((&args[0]).try_into()?)),+ ScalarFunction::NullIf => Ok(nullif((&args[0]).try_into()?)),ScalarFunction::Digest => {Ok(digest((&args[0]).try_into()?, (&args[1]).try_into()?))}+ ScalarFunction::Ascii => Ok(ascii((&args[0]).try_into()?)),+ ScalarFunction::BitLength => Ok((&args[0]).try_into()?),+ ScalarFunction::CharacterLength => {+ Ok(character_length((&args[0]).try_into()?))+ }+ ScalarFunction::Chr => Ok(chr((&args[0]).try_into()?)),+ ScalarFunction::InitCap => Ok(ascii((&args[0]).try_into()?)),+ ScalarFunction::Left => {+ Ok(left((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::Random => Ok(random()),+ ScalarFunction::Repeat => {+ Ok(repeat((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::Replace => Ok(replace(+ (&args[0]).try_into()?,+ (&args[1]).try_into()?,+ (&args[2]).try_into()?,+ )),+ ScalarFunction::Reverse => Ok(reverse((&args[0]).try_into()?)),+ ScalarFunction::Right => {+ Ok(right((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::Concat => Ok(concat_expr(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::ConcatWithSeparator => Ok(concat_ws_expr(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::Lpad => Ok(lpad(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::Rpad => Ok(rpad(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::RegexpReplace => Ok(regexp_replace(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::RegexpMatch => Ok(regexp_match(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::Btrim => Ok(btrim(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::SplitPart => Ok(split_part(+ (&args[0]).try_into()?,+ (&args[1]).try_into()?,+ (&args[2]).try_into()?,+ )),+ ScalarFunction::StartsWith => {+ Ok(starts_with((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::Strpos => {+ Ok(strpos((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::Substr => {+ Ok(substr((&args[0]).try_into()?, (&args[1]).try_into()?))+ }+ ScalarFunction::ToHex => Ok(to_hex((&args[0]).try_into()?)),+ ScalarFunction::ToTimestampMillis => {+ Ok(to_timestamp_millis((&args[0]).try_into()?))+ }+ ScalarFunction::ToTimestampMicros => {+ Ok(to_timestamp_micros((&args[0]).try_into()?))+ }+ ScalarFunction::ToTimestampSeconds => {+ Ok(to_timestamp_seconds((&args[0]).try_into()?))+ }+ ScalarFunction::Now => Ok(now_expr(+ args.to_owned()+ .iter()+ .map(|e| e.try_into())+ .collect::<Result<Vec<_>, _>>()?,+ )),+ ScalarFunction::Translate => Ok(translate(+ (&args[0]).try_into()?,+ (&args[1]).try_into()?,+ (&args[2]).try_into()?,+ )),_ => Err(proto_error("Protobuf deserialization error: Unsupported scalar function",)),diff --git a/datafusion-proto/src/to_proto.rs b/datafusion-proto/src/to_proto.rsindex 840db49de1..29c533a560 100644--- a/datafusion-proto/src/to_proto.rs+++ b/datafusion-proto/src/to_proto.rs@@ -119,10 +119,6 @@ impl Error {fn invalid_time_unit(time_unit: &TimeUnit) -> Self {Self::InvalidTimeUnit(time_unit.to_owned())}-- fn unsupported_scalar_function(function: &BuiltinScalarFunction) -> Self {- Self::UnsupportedScalarFunction(function.to_owned())- }}impl From<&Field> for protobuf::Field {@@ -933,26 +929,53 @@ impl TryFrom<&BuiltinScalarFunction> for protobuf::ScalarFunction {BuiltinScalarFunction::Round => Self::Round,BuiltinScalarFunction::Trunc => Self::Trunc,BuiltinScalarFunction::Abs => Self::Abs,- BuiltinScalarFunction::OctetLength => Self::Octetlength,+ BuiltinScalarFunction::OctetLength => Self::OctetLength,BuiltinScalarFunction::Concat => Self::Concat,BuiltinScalarFunction::Lower => Self::Lower,BuiltinScalarFunction::Upper => Self::Upper,BuiltinScalarFunction::Trim => Self::Trim,BuiltinScalarFunction::Ltrim => Self::Ltrim,BuiltinScalarFunction::Rtrim => Self::Rtrim,- BuiltinScalarFunction::ToTimestamp => Self::Totimestamp,+ BuiltinScalarFunction::ToTimestamp => Self::ToTimestamp,BuiltinScalarFunction::Array => Self::Array,- BuiltinScalarFunction::NullIf => Self::Nullif,- BuiltinScalarFunction::DatePart => Self::Datepart,- BuiltinScalarFunction::DateTrunc => Self::Datetrunc,+ BuiltinScalarFunction::NullIf => Self::NullIf,+ BuiltinScalarFunction::DatePart => Self::DatePart,+ BuiltinScalarFunction::DateTrunc => Self::DateTrunc,BuiltinScalarFunction::MD5 => Self::Md5,BuiltinScalarFunction::SHA224 => Self::Sha224,BuiltinScalarFunction::SHA256 => Self::Sha256,BuiltinScalarFunction::SHA384 => Self::Sha384,BuiltinScalarFunction::SHA512 => Self::Sha512,BuiltinScalarFunction::Digest => Self::Digest,- BuiltinScalarFunction::ToTimestampMillis => Self::Totimestampmillis,- _ => return Err(Error::unsupported_scalar_function(scalar)),+ BuiltinScalarFunction::ToTimestampMillis => Self::ToTimestampMillis,+ BuiltinScalarFunction::Log2 => Self::Log2,+ BuiltinScalarFunction::Signum => Self::Signum,+ BuiltinScalarFunction::Ascii => Self::Ascii,+ BuiltinScalarFunction::BitLength => Self::BitLength,+ BuiltinScalarFunction::Btrim => Self::Btrim,+ BuiltinScalarFunction::CharacterLength => Self::CharacterLength,+ BuiltinScalarFunction::Chr => Self::Chr,+ BuiltinScalarFunction::ConcatWithSeparator => Self::ConcatWithSeparator,+ BuiltinScalarFunction::InitCap => Self::InitCap,+ BuiltinScalarFunction::Left => Self::Left,+ BuiltinScalarFunction::Lpad => Self::Lpad,+ BuiltinScalarFunction::Random => Self::Random,+ BuiltinScalarFunction::RegexpReplace => Self::RegexpReplace,+ BuiltinScalarFunction::Repeat => Self::Repeat,+ BuiltinScalarFunction::Replace => Self::Replace,+ BuiltinScalarFunction::Reverse => Self::Reverse,+ BuiltinScalarFunction::Right => Self::Right,+ BuiltinScalarFunction::Rpad => Self::Rpad,+ BuiltinScalarFunction::SplitPart => Self::SplitPart,+ BuiltinScalarFunction::StartsWith => Self::StartsWith,+ BuiltinScalarFunction::Strpos => Self::Strpos,+ BuiltinScalarFunction::Substr => Self::Substr,+ BuiltinScalarFunction::ToHex => Self::ToHex,+ BuiltinScalarFunction::ToTimestampMicros => Self::ToTimestampMicros,+ BuiltinScalarFunction::ToTimestampSeconds => Self::ToTimestampSeconds,+ BuiltinScalarFunction::Now => Self::Now,+ BuiltinScalarFunction::Translate => Self::Translate,+ BuiltinScalarFunction::RegexpMatch => Self::RegexpMatch,};Ok(scalar_function)diff --git a/datafusion/src/logical_plan/mod.rs b/datafusion/src/logical_plan/mod.rsindex 24d6723210..9173279b54 100644--- a/datafusion/src/logical_plan/mod.rs+++ b/datafusion/src/logical_plan/mod.rs@@ -43,14 +43,15 @@ pub use display::display_schema;pub use expr::{abs, acos, and, approx_distinct, approx_percentile_cont, array, ascii, asin, atan,avg, bit_length, btrim, call_fn, case, ceil, character_length, chr, col,- columnize_expr, combine_filters, concat, concat_ws, cos, count, count_distinct,- create_udaf, create_udf, date_part, date_trunc, digest, exp, exprlist_to_fields,- floor, in_list, initcap, left, length, lit, lit_timestamp_nano, ln, log10, log2,- lower, lpad, ltrim, max, md5, min, now, octet_length, or, random, regexp_match,- regexp_replace, repeat, replace, reverse, right, round, rpad, rtrim, sha224, sha256,- sha384, sha512, signum, sin, split_part, sqrt, starts_with, strpos, substr, sum, tan,- to_hex, translate, trim, trunc, unalias, upper, when, Column, Expr, ExprSchema,- Literal,+ columnize_expr, combine_filters, concat, concat_expr, concat_ws, concat_ws_expr, cos,+ count, count_distinct, create_udaf, create_udf, date_part, date_trunc, digest, exp,+ exprlist_to_fields, floor, in_list, initcap, left, length, lit, lit_timestamp_nano,+ ln, log10, log2, lower, lpad, ltrim, max, md5, min, now, now_expr, nullif,+ octet_length, or, random, regexp_match, regexp_replace, repeat, replace, reverse,+ right, round, rpad, rtrim, sha224, sha256, sha384, sha512, signum, sin, split_part,+ sqrt, starts_with, strpos, substr, sum, tan, to_hex, to_timestamp_micros,+ to_timestamp_millis, to_timestamp_seconds, translate, trim, trunc, unalias, upper,+ when, Column, Expr, ExprSchema, Literal,};pub use expr_rewriter::{normalize_col, normalize_cols, replace_col, rewrite_sort_cols_by_aggs,