2010YOUY01 commented on code in PR #8258:
URL: https://github.com/apache/arrow-datafusion/pull/8258#discussion_r1397934307
##########
datafusion/expr/src/expr.rs:
##########
@@ -338,37 +336,43 @@ impl Between {
}
}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum ScalarFunctionDefinition {
+ /// Resolved to a `BuiltinScalarFunction`
+ /// There is plan to migrate `BuiltinScalarFunction` to UDF-based
implementation (issue#8045)
+ /// This variant is planned to be removed in long term
+ BuiltIn(built_in_function::BuiltinScalarFunction),
+ /// Resolved to a user defined function
+ UDF(Arc<crate::ScalarUDF>),
+ /// A scalar function constructed with name, could be resolved with
registered functions during
+ /// analyzing.
+ Name(Arc<str>),
+}
+
/// ScalarFunction expression invokes a built-in scalar function
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct ScalarFunction {
/// The function
- pub fun: built_in_function::BuiltinScalarFunction,
+ pub func_def: ScalarFunctionDefinition,
/// List of expressions to feed to the functions as arguments
pub args: Vec<Expr>,
}
impl ScalarFunction {
/// Create a new ScalarFunction expression
pub fn new(fun: built_in_function::BuiltinScalarFunction, args: Vec<Expr>)
-> Self {
- Self { fun, args }
+ Self {
+ func_def: ScalarFunctionDefinition::BuiltIn(fun),
+ args,
+ }
}
-}
Review Comment:
This is the major change
##########
datafusion/expr/src/expr.rs:
##########
@@ -338,37 +336,43 @@ impl Between {
}
}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum ScalarFunctionDefinition {
+ /// Resolved to a `BuiltinScalarFunction`
+ /// There is plan to migrate `BuiltinScalarFunction` to UDF-based
implementation (issue#8045)
+ /// This variant is planned to be removed in long term
+ BuiltIn(built_in_function::BuiltinScalarFunction),
+ /// Resolved to a user defined function
+ UDF(Arc<crate::ScalarUDF>),
+ /// A scalar function constructed with name, could be resolved with
registered functions during
+ /// analyzing.
+ Name(Arc<str>),
+}
+
/// ScalarFunction expression invokes a built-in scalar function
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct ScalarFunction {
/// The function
- pub fun: built_in_function::BuiltinScalarFunction,
+ pub func_def: ScalarFunctionDefinition,
Review Comment:
This is the major change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]