@@ -22,11 +22,10 @@ use std::fmt;
2222use std:: str:: FromStr ;
2323use std:: sync:: { Arc , OnceLock } ;
2424
25- use crate :: signature:: TIMEZONE_WILDCARD ;
2625use crate :: type_coercion:: functions:: data_types;
2726use crate :: { FuncMonotonicity , Signature , TypeSignature , Volatility } ;
2827
29- use arrow:: datatypes:: { DataType , Field , TimeUnit } ;
28+ use arrow:: datatypes:: { DataType , Field } ;
3029use datafusion_common:: { plan_err, DataFusionError , Result } ;
3130
3231use strum:: IntoEnumIterator ;
@@ -190,8 +189,6 @@ pub enum BuiltinScalarFunction {
190189 Substr ,
191190 /// to_hex
192191 ToHex ,
193- /// make_date
194- MakeDate ,
195192 /// translate
196193 Translate ,
197194 /// trim
@@ -208,8 +205,6 @@ pub enum BuiltinScalarFunction {
208205 SubstrIndex ,
209206 /// find_in_set
210207 FindInSet ,
211- /// to_char
212- ToChar ,
213208}
214209
215210/// Maps the sql function name to `BuiltinScalarFunction`
@@ -335,8 +330,6 @@ impl BuiltinScalarFunction {
335330 BuiltinScalarFunction :: Strpos => Volatility :: Immutable ,
336331 BuiltinScalarFunction :: Substr => Volatility :: Immutable ,
337332 BuiltinScalarFunction :: ToHex => Volatility :: Immutable ,
338- BuiltinScalarFunction :: ToChar => Volatility :: Immutable ,
339- BuiltinScalarFunction :: MakeDate => Volatility :: Immutable ,
340333 BuiltinScalarFunction :: Translate => Volatility :: Immutable ,
341334 BuiltinScalarFunction :: Trim => Volatility :: Immutable ,
342335 BuiltinScalarFunction :: Upper => Volatility :: Immutable ,
@@ -490,8 +483,6 @@ impl BuiltinScalarFunction {
490483 BuiltinScalarFunction :: FindInSet => {
491484 utf8_to_int_type ( & input_expr_types[ 0 ] , "find_in_set" )
492485 }
493- BuiltinScalarFunction :: ToChar => Ok ( Utf8 ) ,
494- BuiltinScalarFunction :: MakeDate => Ok ( Date32 ) ,
495486 BuiltinScalarFunction :: Translate => {
496487 utf8_to_str_type ( & input_expr_types[ 0 ] , "translate" )
497488 }
@@ -567,7 +558,6 @@ impl BuiltinScalarFunction {
567558 /// Return the argument [`Signature`] supported by this function
568559 pub fn signature ( & self ) -> Signature {
569560 use DataType :: * ;
570- use TimeUnit :: * ;
571561 use TypeSignature :: * ;
572562 // note: the physical expression must accept the type returned by this function or the execution panics.
573563
@@ -651,41 +641,6 @@ impl BuiltinScalarFunction {
651641 vec ! [ Exact ( vec![ Utf8 , Int64 ] ) , Exact ( vec![ LargeUtf8 , Int64 ] ) ] ,
652642 self . volatility ( ) ,
653643 ) ,
654- BuiltinScalarFunction :: ToChar => Signature :: one_of (
655- vec ! [
656- Exact ( vec![ Date32 , Utf8 ] ) ,
657- Exact ( vec![ Date64 , Utf8 ] ) ,
658- Exact ( vec![ Time32 ( Millisecond ) , Utf8 ] ) ,
659- Exact ( vec![ Time32 ( Second ) , Utf8 ] ) ,
660- Exact ( vec![ Time64 ( Microsecond ) , Utf8 ] ) ,
661- Exact ( vec![ Time64 ( Nanosecond ) , Utf8 ] ) ,
662- Exact ( vec![ Timestamp ( Second , None ) , Utf8 ] ) ,
663- Exact ( vec![
664- Timestamp ( Second , Some ( TIMEZONE_WILDCARD . into( ) ) ) ,
665- Utf8 ,
666- ] ) ,
667- Exact ( vec![ Timestamp ( Millisecond , None ) , Utf8 ] ) ,
668- Exact ( vec![
669- Timestamp ( Millisecond , Some ( TIMEZONE_WILDCARD . into( ) ) ) ,
670- Utf8 ,
671- ] ) ,
672- Exact ( vec![ Timestamp ( Microsecond , None ) , Utf8 ] ) ,
673- Exact ( vec![
674- Timestamp ( Microsecond , Some ( TIMEZONE_WILDCARD . into( ) ) ) ,
675- Utf8 ,
676- ] ) ,
677- Exact ( vec![ Timestamp ( Nanosecond , None ) , Utf8 ] ) ,
678- Exact ( vec![
679- Timestamp ( Nanosecond , Some ( TIMEZONE_WILDCARD . into( ) ) ) ,
680- Utf8 ,
681- ] ) ,
682- Exact ( vec![ Duration ( Second ) , Utf8 ] ) ,
683- Exact ( vec![ Duration ( Millisecond ) , Utf8 ] ) ,
684- Exact ( vec![ Duration ( Microsecond ) , Utf8 ] ) ,
685- Exact ( vec![ Duration ( Nanosecond ) , Utf8 ] ) ,
686- ] ,
687- self . volatility ( ) ,
688- ) ,
689644 BuiltinScalarFunction :: SplitPart => Signature :: one_of (
690645 vec ! [
691646 Exact ( vec![ Utf8 , Utf8 , Int64 ] ) ,
@@ -821,11 +776,6 @@ impl BuiltinScalarFunction {
821776 // will be as good as the number of digits in the number
822777 Signature :: uniform ( 1 , vec ! [ Float64 , Float32 ] , self . volatility ( ) )
823778 }
824- BuiltinScalarFunction :: MakeDate => Signature :: uniform (
825- 3 ,
826- vec ! [ Int32 , Int64 , UInt32 , UInt64 , Utf8 ] ,
827- self . volatility ( ) ,
828- ) ,
829779 BuiltinScalarFunction :: Iszero => Signature :: one_of (
830780 vec ! [ Exact ( vec![ Float32 ] ) , Exact ( vec![ Float64 ] ) ] ,
831781 self . volatility ( ) ,
@@ -943,10 +893,6 @@ impl BuiltinScalarFunction {
943893 BuiltinScalarFunction :: SubstrIndex => & [ "substr_index" , "substring_index" ] ,
944894 BuiltinScalarFunction :: FindInSet => & [ "find_in_set" ] ,
945895
946- // time/date functions
947- BuiltinScalarFunction :: MakeDate => & [ "make_date" ] ,
948- BuiltinScalarFunction :: ToChar => & [ "to_char" , "date_format" ] ,
949-
950896 // hashing functions
951897 BuiltinScalarFunction :: ArrayElement => & [
952898 "array_element" ,
0 commit comments