pub enum Expression {
Show 18 variants
Literal(LiteralExpression),
ColumnReference(ColumnReference),
UnresolvedFunction(UnresolvedFunction),
UnresolvedStar(Option<String>),
Alias(Box<Alias>),
Cast(Box<Cast>),
DirectShufflePartitionId(Box<Expression>),
UnresolvedRegex(String),
SortOrder(Box<SortOrder>),
CaseWhen(Box<CaseWhen>),
UnresolvedExtractValue(Box<ExtractValue>),
UpdateFields(Box<UpdateFieldsExpr>),
SQLExpression(String),
CallFunction(Box<CallFunctionWrapper>),
WindowExpression(Box<WindowExpressionWrapper>),
LambdaFunction(Box<LambdaFunction>),
UnresolvedNamedLambdaVariable(UnresolvedNamedLambdaVariable),
CommonInlineUserDefinedFunction(Box<CommonInlineUserDefinedFunctionExpression>),
}Expand description
The base Expression type, mirroring pyspark.sql.connect.expressions.Expression.
All expressions are represented as variants of this enum. Each variant carries the data needed to construct the corresponding proto expression.
Variants§
Literal(LiteralExpression)
pyspark.sql.connect.expressions.LiteralExpression - a constant value.
ColumnReference(ColumnReference)
pyspark.sql.connect.expressions.ColumnReference - a reference to a column.
UnresolvedFunction(UnresolvedFunction)
pyspark.sql.connect.expressions.UnresolvedFunction - a function call.
UnresolvedStar(Option<String>)
pyspark.sql.connect.expressions.UnresolvedStar - a star expression (*).
Carries an optional target ending in .* (e.g. df.* from col("df.*")).
Alias(Box<Alias>)
pyspark.sql.connect.expressions.ColumnAlias / Alias - an aliased expression.
Cast(Box<Cast>)
pyspark.sql.connect.expressions.CastExpression - a cast expression.
DirectShufflePartitionId(Box<Expression>)
spark.connect.Expression.DirectShufflePartitionID - wraps a child expression
that evaluates to a partition id (used by DataFrame.repartitionById).
UnresolvedRegex(String)
pyspark.sql.connect.expressions.UnresolvedRegex - a regex column reference.
SortOrder(Box<SortOrder>)
pyspark.sql.connect.expressions.SortOrder - a sort order expression.
CaseWhen(Box<CaseWhen>)
pyspark.sql.connect.expressions.CaseWhen - a CASE WHEN expression.
UnresolvedExtractValue(Box<ExtractValue>)
pyspark.sql.connect.expressions.UnresolvedExtractValue - col[k] / getField.
UpdateFields(Box<UpdateFieldsExpr>)
pyspark.sql.connect.expressions.UpdateFields - withField / dropFields.
SQLExpression(String)
pyspark.sql.connect.expressions.SQLExpression - a raw SQL expression.
CallFunction(Box<CallFunctionWrapper>)
pyspark.sql.connect.expressions.CallFunction - a direct function call.
WindowExpression(Box<WindowExpressionWrapper>)
pyspark.sql.connect.expressions.WindowExpression - a window function call.
LambdaFunction(Box<LambdaFunction>)
pyspark.sql.connect.expressions.LambdaFunction - a lambda function.
UnresolvedNamedLambdaVariable(UnresolvedNamedLambdaVariable)
pyspark.sql.connect.expressions.UnresolvedNamedLambdaVariable - a lambda variable.
CommonInlineUserDefinedFunction(Box<CommonInlineUserDefinedFunctionExpression>)
pyspark.sql.connect.expressions.CommonInlineUserDefinedFunction - a UDF expression.
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Render this expression to a human-readable string, mirroring the
__repr__ of pyspark.sql.connect.expressions.*.
This is what Column.__repr__ wraps as Column<'...'>. pandas-on-Spark’s
spark_column_equals compares these strings (after stripping backticks) to
decide column equality, so the rendering must be deterministic and mirror
PySpark’s format for the common operators.
Sourcepub fn to_proto(&self) -> Expression
pub fn to_proto(&self) -> Expression
Converts the expression to a Spark Connect protobuf expression.
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
Blanket Implementations§
impl<T> Allocation for T
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