-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
In BuiltInWindowFunction::{Lead, Lag} to create an instance of PartitionEvaluator directly/indirectly depends on the following being available:
- arguments to the window function expression,
- the data type of the arguments,
- whether
IGNORE NULLSis specified, - whether the execution order is reversed.
Currently none of this is available when implementing user-defined window functions.
Describe the solution you'd like
- Add
PartitionEvaluatorArgstoWindowUDFImpl::partition_evaulator.
pub trait WindowUDFImpl: Debug + Send + Sync {
/// Invoke the function, returning the [`PartitionEvaluator`] instance
fn partition_evaluator(
&self,
partition_evaluator_args: PartitionEvaluatorArgs,
) -> Result<Box<dyn PartitionEvaluator>>;
}- Define
PartitionEvaluatorArgs:
/// Defines the state of the user-defined window function during
/// physical execution.
#[derive(Debug, Default)]
pub struct PartitionEvaluatorArgs<'a> {
/// The expressions passed as arguments to the user-defined window
/// function.
input_exprs: &'a [Arc<dyn PhysicalExpr>],
/// The corresponding data types of expressions passed as arguments
/// to the user-defined window function.
input_types: &'a [DataType],
/// Set to `true` if the user-defined window function is reversed.
is_reversed: bool,
/// Set to `true` if `IGNORE NULLS` is specified.
ignore_nulls: bool,
}Describe alternatives you've considered
No response
Additional context
Part of #12802.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request