pub struct GroupedData { /* private fields */ }Expand description
Grouped data for performing aggregations.
Mirrors pyspark.sql.GroupedData.
Implementations§
Source§impl GroupedData
impl GroupedData
Sourcepub fn pivot(
&self,
pivot_col: Column,
values: Option<Vec<Value>>,
) -> GroupedData
pub fn pivot( &self, pivot_col: Column, values: Option<Vec<Value>>, ) -> GroupedData
Pivot on a column, optionally with explicit values (GroupedData.pivot).
Mirrors df.groupBy(...).pivot(col, values). When values is None the
server computes the distinct values; when supplied they are serialized as
pivot-value literals (previously they were dropped entirely).
Sourcepub fn input_columns(&self) -> Result<Vec<String>>
pub fn input_columns(&self) -> Result<Vec<String>>
Column names of the underlying (pre-grouping) DataFrame. These are passed as the map/apply UDF’s argument columns so the worker’s pandas/Arrow input is named.
Sourcepub fn apply_in_pandas(
&self,
func: CommonInlineUserDefinedFunctionExpression,
) -> DataFrame
pub fn apply_in_pandas( &self, func: CommonInlineUserDefinedFunctionExpression, ) -> DataFrame
Apply a pandas UDF to each group (GroupedData.applyInPandas).
func is built on the Python side (cloudpickled, eval type
SQL_GROUPED_MAP_PANDAS_UDF).
Sourcepub fn apply_in_arrow(
&self,
func: CommonInlineUserDefinedFunctionExpression,
) -> DataFrame
pub fn apply_in_arrow( &self, func: CommonInlineUserDefinedFunctionExpression, ) -> DataFrame
Apply an Arrow UDF to each group (GroupedData.applyInArrow).
Sourcepub fn apply_in_pandas_with_state(
&self,
func: CommonInlineUserDefinedFunctionExpression,
state_schema: DataType,
output_mode: &str,
timeout_conf: &str,
) -> DataFrame
pub fn apply_in_pandas_with_state( &self, func: CommonInlineUserDefinedFunctionExpression, state_schema: DataType, output_mode: &str, timeout_conf: &str, ) -> DataFrame
Apply a stateful pandas UDF to each group (GroupedData.applyInPandasWithState).
func (built on the Python side with eval type
SQL_GROUPED_MAP_PANDAS_UDF_WITH_STATE and carrying the output schema as its
return type) is combined with the state schema, output mode, and timeout.
Sourcepub fn transform_with_state(
&self,
func: CommonInlineUserDefinedFunctionExpression,
output_mode: &str,
time_mode: &str,
event_time_column_name: Option<&str>,
initial_state: Option<&GroupedData>,
) -> DataFrame
pub fn transform_with_state( &self, func: CommonInlineUserDefinedFunctionExpression, output_mode: &str, time_mode: &str, event_time_column_name: Option<&str>, initial_state: Option<&GroupedData>, ) -> DataFrame
GroupedData.transformWithState (row output). func is the cloudpickled
stateful processor (eval type in the 211-214 range).
Sourcepub fn transform_with_state_in_pandas(
&self,
func: CommonInlineUserDefinedFunctionExpression,
output_schema: DataType,
output_mode: &str,
time_mode: &str,
event_time_column_name: Option<&str>,
initial_state: Option<&GroupedData>,
) -> DataFrame
pub fn transform_with_state_in_pandas( &self, func: CommonInlineUserDefinedFunctionExpression, output_schema: DataType, output_mode: &str, time_mode: &str, event_time_column_name: Option<&str>, initial_state: Option<&GroupedData>, ) -> DataFrame
GroupedData.transformWithStateInPandas (carries the output schema in the
TransformWithStateInfo).
Sourcepub fn cogroup(&self, other: &GroupedData) -> CoGroupedData
pub fn cogroup(&self, other: &GroupedData) -> CoGroupedData
Cogroup this grouped data with another (GroupedData.cogroup).
Sourcepub fn agg(&self, expressions: Vec<Expression>) -> DataFrame
pub fn agg(&self, expressions: Vec<Expression>) -> DataFrame
Perform an aggregation.
Trait Implementations§
Source§impl Clone for GroupedData
impl Clone for GroupedData
Source§fn clone(&self) -> GroupedData
fn clone(&self) -> GroupedData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for GroupedData
impl !RefUnwindSafe for GroupedData
impl !UnwindSafe for GroupedData
impl Send for GroupedData
impl Sync for GroupedData
impl Unpin for GroupedData
impl UnsafeUnpin for GroupedData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request