File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,13 @@ pub trait AggregateUDFImpl: Debug + DynEq + DynHash + Send + Sync {
671671 ///
672672 /// closure returns simplified [Expr] or an error.
673673 ///
674+ /// # Notes
675+ ///
676+ /// The returned expression must have the same schema as the original
677+ /// expression, including both the data type and nullability. For example,
678+ /// if the original expression is nullable, the returned expression must
679+ /// also be nullable, otherwise it may lead to schema verification errors
680+ /// later in query planning.
674681 fn simplify ( & self ) -> Option < AggregateFunctionSimplification > {
675682 None
676683 }
Original file line number Diff line number Diff line change @@ -635,6 +635,14 @@ pub trait ScalarUDFImpl: Debug + DynEq + DynHash + Send + Sync {
635635 /// [`ExprSimplifyResult`] indicating the result of the simplification NOTE
636636 /// if the function cannot be simplified, the arguments *MUST* be returned
637637 /// unmodified
638+ ///
639+ /// # Notes
640+ ///
641+ /// The returned expression must have the same schema as the original
642+ /// expression, including both the data type and nullability. For example,
643+ /// if the original expression is nullable, the returned expression must
644+ /// also be nullable, otherwise it may lead to schema verification errors
645+ /// later in query planning.
638646 fn simplify (
639647 & self ,
640648 args : Vec < Expr > ,
Original file line number Diff line number Diff line change @@ -358,6 +358,13 @@ pub trait WindowUDFImpl: Debug + DynEq + DynHash + Send + Sync {
358358 /// Or, a closure with two arguments:
359359 /// * 'window_function': [crate::expr::WindowFunction] for which simplified has been invoked
360360 /// * 'info': [crate::simplify::SimplifyInfo]
361+ ///
362+ /// # Notes
363+ /// The returned expression must have the same schema as the original
364+ /// expression, including both the data type and nullability. For example,
365+ /// if the original expression is nullable, the returned expression must
366+ /// also be nullable, otherwise it may lead to schema verification errors
367+ /// later in query planning.
361368 fn simplify ( & self ) -> Option < WindowFunctionSimplification > {
362369 None
363370 }
You can’t perform that action at this time.
0 commit comments