@@ -28,8 +28,8 @@ use crate::logical_plan::Subquery;
28
28
use crate :: utils:: expr_to_columns;
29
29
use crate :: window_frame;
30
30
use crate :: {
31
- aggregate_function, built_in_function , built_in_window_function, udaf,
32
- BuiltinScalarFunction , ExprSchemable , Operator , Signature ,
31
+ aggregate_function, built_in_window_function, udaf, ExprSchemable , Operator ,
32
+ Signature ,
33
33
} ;
34
34
35
35
use arrow:: datatypes:: DataType ;
@@ -362,10 +362,6 @@ impl Between {
362
362
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
363
363
/// Defines which implementation of a function for DataFusion to call.
364
364
pub enum ScalarFunctionDefinition {
365
- /// Resolved to a `BuiltinScalarFunction`
366
- /// There is plan to migrate `BuiltinScalarFunction` to UDF-based implementation (issue#8045)
367
- /// This variant is planned to be removed in long term
368
- BuiltIn ( BuiltinScalarFunction ) ,
369
365
/// Resolved to a user defined function
370
366
UDF ( Arc < crate :: ScalarUDF > ) ,
371
367
/// A scalar function constructed with name. This variant can not be executed directly
@@ -393,7 +389,6 @@ impl ScalarFunctionDefinition {
393
389
/// Function's name for display
394
390
pub fn name ( & self ) -> & str {
395
391
match self {
396
- ScalarFunctionDefinition :: BuiltIn ( fun) => fun. name ( ) ,
397
392
ScalarFunctionDefinition :: UDF ( udf) => udf. name ( ) ,
398
393
ScalarFunctionDefinition :: Name ( func_name) => func_name. as_ref ( ) ,
399
394
}
@@ -403,9 +398,6 @@ impl ScalarFunctionDefinition {
403
398
/// when evaluated multiple times with the same input.
404
399
pub fn is_volatile ( & self ) -> Result < bool > {
405
400
match self {
406
- ScalarFunctionDefinition :: BuiltIn ( fun) => {
407
- Ok ( fun. volatility ( ) == crate :: Volatility :: Volatile )
408
- }
409
401
ScalarFunctionDefinition :: UDF ( udf) => {
410
402
Ok ( udf. signature ( ) . volatility == crate :: Volatility :: Volatile )
411
403
}
@@ -419,14 +411,6 @@ impl ScalarFunctionDefinition {
419
411
}
420
412
421
413
impl ScalarFunction {
422
- /// Create a new ScalarFunction expression
423
- pub fn new ( fun : built_in_function:: BuiltinScalarFunction , args : Vec < Expr > ) -> Self {
424
- Self {
425
- func_def : ScalarFunctionDefinition :: BuiltIn ( fun) ,
426
- args,
427
- }
428
- }
429
-
430
414
/// Create a new ScalarFunction expression with a user-defined function (UDF)
431
415
pub fn new_udf ( udf : Arc < crate :: ScalarUDF > , args : Vec < Expr > ) -> Self {
432
416
Self {
@@ -1282,7 +1266,7 @@ impl Expr {
1282
1266
pub fn short_circuits ( & self ) -> bool {
1283
1267
match self {
1284
1268
Expr :: ScalarFunction ( ScalarFunction { func_def, .. } ) => {
1285
- matches ! ( func_def, ScalarFunctionDefinition :: BuiltIn ( fun) if * fun == BuiltinScalarFunction :: Coalesce )
1269
+ matches ! ( func_def, ScalarFunctionDefinition :: UDF ( fun) if fun. name ( ) . eq ( "coalesce" ) )
1286
1270
}
1287
1271
Expr :: BinaryExpr ( BinaryExpr { op, .. } ) => {
1288
1272
matches ! ( op, Operator :: And | Operator :: Or )
0 commit comments