datafusion_functions_window::rank

Struct Rank

Source
pub struct Rank { /* private fields */ }
Expand description

Rank calculates the rank in the window function with order by

Implementations§

Source§

impl Rank

Source

pub fn new(name: String, rank_type: RankType) -> Self

Create a new rank function with the specified name and rank type

Source

pub fn basic() -> Self

Create a rank window function

Source

pub fn dense_rank() -> Self

Create a dense_rank window function

Source

pub fn percent_rank() -> Self

Create a percent_rank window function

Trait Implementations§

Source§

impl Debug for Rank

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl WindowUDFImpl for Rank

Source§

fn as_any(&self) -> &dyn Any

Returns this object as an Any trait object
Source§

fn name(&self) -> &str

Returns this function’s name
Source§

fn signature(&self) -> &Signature

Returns the function’s Signature for information about what input types are accepted and the function’s Volatility.
Source§

fn partition_evaluator( &self, _partition_evaluator_args: PartitionEvaluatorArgs<'_>, ) -> Result<Box<dyn PartitionEvaluator>>

Invoke the function, returning the PartitionEvaluator instance
Source§

fn field(&self, field_args: WindowUDFFieldArgs<'_>) -> Result<Field>

The Field of the final result of evaluating this window function. Read more
Source§

fn sort_options(&self) -> Option<SortOptions>

Allows the window UDF to define a custom result ordering. Read more
Source§

fn documentation(&self) -> Option<&Documentation>

Returns the documentation for this Window UDF. Read more
Source§

fn expressions( &self, expr_args: ExpressionArgs<'_>, ) -> Vec<Arc<dyn PhysicalExpr>>

Returns the expressions that are passed to the PartitionEvaluator.
Source§

fn aliases(&self) -> &[String]

Returns any aliases (alternate names) for this function. Read more
Source§

fn simplify( &self, ) -> Option<Box<dyn Fn(WindowFunction, &dyn SimplifyInfo) -> Result<Expr, DataFusionError>>>

Optionally apply per-UDWF simplification / rewrite rules. Read more
Source§

fn equals(&self, other: &dyn WindowUDFImpl) -> bool

Return true if this window UDF is equal to the other. Read more
Source§

fn hash_value(&self) -> u64

Returns a hash value for this window UDF. Read more
Source§

fn coerce_types( &self, _arg_types: &[DataType], ) -> Result<Vec<DataType>, DataFusionError>

Coerce arguments of a function call to types that the function can evaluate. Read more
Source§

fn reverse_expr(&self) -> ReversedUDWF

Allows customizing the behavior of the user-defined window function when it is evaluated in reverse order.

Auto Trait Implementations§

§

impl Freeze for Rank

§

impl RefUnwindSafe for Rank

§

impl Send for Rank

§

impl Sync for Rank

§

impl Unpin for Rank

§

impl UnwindSafe for Rank

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,