pub struct SedonaAggregateUDF { /* private fields */ }Expand description
Top-level aggregate user-defined function
This struct implements datafusion’s AggregateUDFImpl and implements kernel dispatch such that implementations can be registered flexibly.
Implementations§
Source§impl SedonaAggregateUDF
impl SedonaAggregateUDF
Sourcepub fn new(
name: &str,
kernels: Vec<SedonaAccumulatorRef>,
volatility: Volatility,
documentation: Option<Documentation>,
) -> Self
pub fn new( name: &str, kernels: Vec<SedonaAccumulatorRef>, volatility: Volatility, documentation: Option<Documentation>, ) -> Self
Create a new SedonaAggregateUDF
Sourcepub fn new_stub(
name: &str,
arg_matcher: ArgMatcher,
volatility: Volatility,
documentation: Option<Documentation>,
) -> Self
pub fn new_stub( name: &str, arg_matcher: ArgMatcher, volatility: Volatility, documentation: Option<Documentation>, ) -> Self
Create a new stub aggregate function
Creates a new aggregate function that calculates a return type but fails when invoked with arguments. This is useful to create stub functions when it is expected that the actual functionality will be registered from one or more independent crates (e.g., ST_Union_Agg(), which may be implemented in sedona-geo or sedona-geography).
Sourcepub fn add_kernel(&mut self, kernel: SedonaAccumulatorRef)
pub fn add_kernel(&mut self, kernel: SedonaAccumulatorRef)
Add a new kernel to an Aggregate UDF
Because kernels are resolved in reverse order, the new kernel will take precedence over any previously added kernels that apply to the same types.
pub fn kernels(&self) -> &[SedonaAccumulatorRef] ⓘ
Trait Implementations§
Source§impl AggregateUDFImpl for SedonaAggregateUDF
impl AggregateUDFImpl for SedonaAggregateUDF
Source§fn signature(&self) -> &Signature
fn signature(&self) -> &Signature
Signature for information about what input
types are accepted and the function’s Volatility.Source§fn coerce_types(&self, arg_types: &[DataType]) -> Result<Vec<DataType>>
fn coerce_types(&self, arg_types: &[DataType]) -> Result<Vec<DataType>>
Source§fn state_fields(&self, args: StateFieldsArgs<'_>) -> Result<Vec<FieldRef>>
fn state_fields(&self, args: StateFieldsArgs<'_>) -> Result<Vec<FieldRef>>
Source§fn return_field(&self, arg_fields: &[FieldRef]) -> Result<FieldRef>
fn return_field(&self, arg_fields: &[FieldRef]) -> Result<FieldRef>
Source§fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType>
fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType>
DataType will be returned by this function, given the types of
the argumentsSource§fn accumulator(
&self,
acc_args: AccumulatorArgs<'_>,
) -> Result<Box<dyn Accumulator>>
fn accumulator( &self, acc_args: AccumulatorArgs<'_>, ) -> Result<Box<dyn Accumulator>>
Accumulator that aggregates values for a specific
group during query execution. Read moreSource§fn documentation(&self) -> Option<&Documentation>
fn documentation(&self) -> Option<&Documentation>
Source§fn aliases(&self) -> &[String]
fn aliases(&self) -> &[String]
Source§fn schema_name(
&self,
params: &AggregateFunctionParams,
) -> Result<String, DataFusionError>
fn schema_name( &self, params: &AggregateFunctionParams, ) -> Result<String, DataFusionError>
Source§fn human_display(
&self,
params: &AggregateFunctionParams,
) -> Result<String, DataFusionError>
fn human_display( &self, params: &AggregateFunctionParams, ) -> Result<String, DataFusionError>
Source§fn window_function_schema_name(
&self,
params: &WindowFunctionParams,
) -> Result<String, DataFusionError>
fn window_function_schema_name( &self, params: &WindowFunctionParams, ) -> Result<String, DataFusionError>
Source§fn display_name(
&self,
params: &AggregateFunctionParams,
) -> Result<String, DataFusionError>
fn display_name( &self, params: &AggregateFunctionParams, ) -> Result<String, DataFusionError>
Source§fn window_function_display_name(
&self,
params: &WindowFunctionParams,
) -> Result<String, DataFusionError>
fn window_function_display_name( &self, params: &WindowFunctionParams, ) -> Result<String, DataFusionError>
Source§fn is_nullable(&self) -> bool
fn is_nullable(&self) -> bool
Source§fn groups_accumulator_supported(&self, _args: AccumulatorArgs<'_>) -> bool
fn groups_accumulator_supported(&self, _args: AccumulatorArgs<'_>) -> bool
GroupsAccumulator implementation. If this returns true,
[Self::create_groups_accumulator] will be called. Read moreSource§fn create_groups_accumulator(
&self,
_args: AccumulatorArgs<'_>,
) -> Result<Box<dyn GroupsAccumulator>, DataFusionError>
fn create_groups_accumulator( &self, _args: AccumulatorArgs<'_>, ) -> Result<Box<dyn GroupsAccumulator>, DataFusionError>
GroupsAccumulator that manages state
for all groups. Read moreSource§fn create_sliding_accumulator(
&self,
args: AccumulatorArgs<'_>,
) -> Result<Box<dyn Accumulator>, DataFusionError>
fn create_sliding_accumulator( &self, args: AccumulatorArgs<'_>, ) -> Result<Box<dyn Accumulator>, DataFusionError>
Source§fn with_beneficial_ordering(
self: Arc<Self>,
_beneficial_ordering: bool,
) -> Result<Option<Arc<dyn AggregateUDFImpl>>, DataFusionError>
fn with_beneficial_ordering( self: Arc<Self>, _beneficial_ordering: bool, ) -> Result<Option<Arc<dyn AggregateUDFImpl>>, DataFusionError>
AggregateOrderSensitivity::Beneficial can still produce
the correct result with possibly more work internally. Read moreSource§fn order_sensitivity(&self) -> AggregateOrderSensitivity
fn order_sensitivity(&self) -> AggregateOrderSensitivity
AggregateOrderSensitivity
for possible options.Source§fn simplify(
&self,
) -> Option<Box<dyn Fn(AggregateFunction, &dyn SimplifyInfo) -> Result<Expr, DataFusionError>>>
fn simplify( &self, ) -> Option<Box<dyn Fn(AggregateFunction, &dyn SimplifyInfo) -> Result<Expr, DataFusionError>>>
Source§fn reverse_expr(&self) -> ReversedUDAF
fn reverse_expr(&self) -> ReversedUDAF
Source§fn is_descending(&self) -> Option<bool>
fn is_descending(&self) -> Option<bool>
Source§fn value_from_stats(
&self,
_statistics_args: &StatisticsArgs<'_>,
) -> Option<ScalarValue>
fn value_from_stats( &self, _statistics_args: &StatisticsArgs<'_>, ) -> Option<ScalarValue>
Source§fn default_value(
&self,
data_type: &DataType,
) -> Result<ScalarValue, DataFusionError>
fn default_value( &self, data_type: &DataType, ) -> Result<ScalarValue, DataFusionError>
null. Read moreSource§fn supports_null_handling_clause(&self) -> bool
fn supports_null_handling_clause(&self) -> bool
[IGNORE NULLS | RESPECT NULLS] clause, return true
If the function does not, return falseSource§fn is_ordered_set_aggregate(&self) -> bool
fn is_ordered_set_aggregate(&self) -> bool
Source§fn set_monotonicity(&self, _data_type: &DataType) -> SetMonotonicity
fn set_monotonicity(&self, _data_type: &DataType) -> SetMonotonicity
SetMonotonicity for details.Source§impl Clone for SedonaAggregateUDF
impl Clone for SedonaAggregateUDF
Source§fn clone(&self) -> SedonaAggregateUDF
fn clone(&self) -> SedonaAggregateUDF
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SedonaAggregateUDF
impl Debug for SedonaAggregateUDF
Source§impl Hash for SedonaAggregateUDF
impl Hash for SedonaAggregateUDF
Source§impl PartialEq for SedonaAggregateUDF
impl PartialEq for SedonaAggregateUDF
impl Eq for SedonaAggregateUDF
Auto Trait Implementations§
impl Freeze for SedonaAggregateUDF
impl !RefUnwindSafe for SedonaAggregateUDF
impl Send for SedonaAggregateUDF
impl Sync for SedonaAggregateUDF
impl Unpin for SedonaAggregateUDF
impl !UnwindSafe for SedonaAggregateUDF
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more