Struct datafusion::logical_expr::WindowUDF
source · pub struct WindowUDF {
pub name: String,
pub signature: Signature,
pub return_type: Arc<dyn Fn(&[DataType]) -> Result<Arc<DataType>, DataFusionError> + Send + Sync>,
pub partition_evaluator_factory: Arc<dyn Fn() -> Result<Box<dyn PartitionEvaluator, Global>, DataFusionError> + Send + Sync>,
}
Expand description
Logical representation of a user-defined window function (UDWF) A UDWF is different from a UDF in that it is stateful across batches.
See the documetnation on PartitionEvaluator
for more details
Fields§
§name: String
name
signature: Signature
signature
return_type: Arc<dyn Fn(&[DataType]) -> Result<Arc<DataType>, DataFusionError> + Send + Sync>
Return type
partition_evaluator_factory: Arc<dyn Fn() -> Result<Box<dyn PartitionEvaluator, Global>, DataFusionError> + Send + Sync>
Return the partition evaluator
Implementations§
source§impl WindowUDF
impl WindowUDF
sourcepub fn new(
name: &str,
signature: &Signature,
return_type: &Arc<dyn Fn(&[DataType]) -> Result<Arc<DataType>, DataFusionError> + Send + Sync>,
partition_evaluator_factory: &Arc<dyn Fn() -> Result<Box<dyn PartitionEvaluator, Global>, DataFusionError> + Send + Sync>
) -> WindowUDF
pub fn new( name: &str, signature: &Signature, return_type: &Arc<dyn Fn(&[DataType]) -> Result<Arc<DataType>, DataFusionError> + Send + Sync>, partition_evaluator_factory: &Arc<dyn Fn() -> Result<Box<dyn PartitionEvaluator, Global>, DataFusionError> + Send + Sync> ) -> WindowUDF
Create a new WindowUDF
sourcepub fn call(
&self,
args: Vec<Expr, Global>,
partition_by: Vec<Expr, Global>,
order_by: Vec<Expr, Global>,
window_frame: WindowFrame
) -> Expr
pub fn call( &self, args: Vec<Expr, Global>, partition_by: Vec<Expr, Global>, order_by: Vec<Expr, Global>, window_frame: WindowFrame ) -> Expr
creates a Expr
that calls the window function given
the partition_by
, order_by
, and window_frame
definition
This utility allows using the UDWF without requiring access to the registry, such as with the DataFrame API.
Trait Implementations§
source§impl PartialEq<WindowUDF> for WindowUDF
impl PartialEq<WindowUDF> for WindowUDF
impl Eq for WindowUDF
Auto Trait Implementations§
impl !RefUnwindSafe for WindowUDF
impl Send for WindowUDF
impl Sync for WindowUDF
impl Unpin for WindowUDF
impl !UnwindSafe for WindowUDF
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.