Skip to main content

Expression

Enum Expression 

Source
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

Source

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.

Source

pub fn to_proto(&self) -> Expression

Converts the expression to a Spark Connect protobuf expression.

Trait Implementations§

Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

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

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

impl PartialEq for Expression

Source§

fn eq(&self, other: &Expression) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Expression

Auto Trait Implementations§

Blanket Implementations§

Source§

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more