Skip to main content

Column

Struct Column 

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

pyspark.sql.connect.column.Column

Represents a column in a DataFrame, built from an Expression. All operations return new Columns by composing expressions.

Implementations§

Source§

impl Column

Source

pub fn new(expr: Expression) -> Self

Create a Column from an Expression.

Source

pub fn expression(&self) -> &Expression

Get the underlying Expression.

Source

pub fn alias(self, name: &str) -> Column

Mirrors pyspark.sql.column.Column.alias.

Source

pub fn alias_with_metadata( self, name: &str, metadata: BTreeMap<String, String>, ) -> Column

Column.alias(name, metadata=...) - attaches column metadata, serialized to a JSON map (matching the reference client’s json.dumps(metadata)).

Source

pub fn name(self, name: &str) -> Column

Mirrors pyspark.sql.column.Column.name (alias for alias).

Source

pub fn cast(self, to_type: DataType) -> Column

Mirrors pyspark.sql.column.Column.cast.

Source

pub fn astype(self, to_type: DataType) -> Column

Mirrors pyspark.sql.column.Column.astype (alias for cast).

Source

pub fn cast_str(self, type_name: &str) -> Column

Mirrors pyspark.sql.column.Column.cast with a DDL type string, e.g. col("x").cast("string")cast { type_str: "string" }.

Source

pub fn try_cast(self, to_type: DataType) -> Column

Mirrors pyspark.sql.column.Column.try_cast.

Source

pub fn try_cast_str(self, type_name: &str) -> Column

Column.try_cast with a DDL type string.

Source

pub fn is_null(self) -> Column

Mirrors pyspark.sql.column.Column.isNull.

Source

pub fn is_not_null(self) -> Column

Mirrors pyspark.sql.column.Column.isNotNull.

Source

pub fn substr(self, start: Column, length: Column) -> Column

Mirrors pyspark.sql.column.Column.substr.

Source

pub fn like(self, pattern: &str) -> Column

Mirrors pyspark.sql.column.Column.like.

Source

pub fn rlike(self, pattern: &str) -> Column

Mirrors pyspark.sql.column.Column.rlike.

Source

pub fn contains(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.contains.

Source

pub fn ilike(self, pattern: &str) -> Column

Mirrors pyspark.sql.column.Column.ilike (case-insensitive like).

Source

pub fn is_nan(self) -> Column

Mirrors pyspark.sql.column.Column.isNaN.

Source

pub fn eq_null_safe(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.eqNullSafe (null-safe equality <=>).

Source

pub fn bitwise_and(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.bitwiseAND.

Source

pub fn bitwise_or(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.bitwiseOR.

Source

pub fn bitwise_xor(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.bitwiseXOR.

Source

pub fn between(self, lower: Column, upper: Column) -> Column

Mirrors pyspark.sql.column.Column.between: (self >= lower) & (self <= upper).

Source

pub fn isin<C: Into<Column>>( self, values: impl IntoIterator<Item = C>, ) -> Column

Mirrors pyspark.sql.column.Column.isin: membership test against the given values (pass literals via lit(..) or other columns).

Source

pub fn with_field(self, field_name: &str, value: Column) -> Column

Mirrors pyspark.sql.column.Column.withField: add or replace a field in a struct-typed column.

Source

pub fn drop_fields(self, field_names: Vec<&str>) -> Column

Mirrors pyspark.sql.column.Column.dropFields: drop one or more fields from a struct-typed column (chained UpdateFields, one per field).

Source

pub fn startswith(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.startswith.

Source

pub fn endswith(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.endswith.

Source

pub fn asc(self) -> Column

Mirrors pyspark.sql.column.Column.asc.

Source

pub fn asc_nulls_first(self) -> Column

Mirrors pyspark.sql.column.Column.asc_nulls_first.

Source

pub fn asc_nulls_last(self) -> Column

Mirrors pyspark.sql.column.Column.asc_nulls_last.

Source

pub fn desc(self) -> Column

Mirrors pyspark.sql.column.Column.desc.

Source

pub fn desc_nulls_first(self) -> Column

Mirrors pyspark.sql.column.Column.desc_nulls_first.

Source

pub fn desc_nulls_last(self) -> Column

Mirrors pyspark.sql.column.Column.desc_nulls_last.

Source

pub fn when(self, condition: Column, value: Column) -> Column

Mirrors pyspark.sql.column.Column.when.

Source

pub fn otherwise(self, value: Column) -> Column

Mirrors pyspark.sql.column.Column.otherwise.

Source

pub fn get_field(self, name: &str) -> Column

Mirrors pyspark.sql.column.Column.getField - struct field access. Builds an UnresolvedExtractValue with the field name as a string literal.

Source

pub fn get_item(self, key: Column) -> Column

Mirrors pyspark.sql.column.Column.__getitem__ / getItem - map/array/struct extraction. Builds an UnresolvedExtractValue.

Source

pub fn to_proto(&self) -> Expression

Convert to proto expression.

Source

pub fn over(self, window_spec: WindowSpec) -> Column

Mirrors pyspark.sql.column.Column.over - window function application.

Source

pub fn eq(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__eq__.

Source

pub fn ne(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__ne__.

Source

pub fn gt(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__gt__.

Source

pub fn lt(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__lt__.

Source

pub fn ge(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__ge__.

Source

pub fn le(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__le__.

Source

pub fn add(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__add__.

Source

pub fn sub(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__sub__.

Source

pub fn mul(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__mul__.

Source

pub fn div(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__truediv__.

Source

pub fn modulo(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__mod__.

Source

pub fn and(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__and__.

Source

pub fn or(self, other: Column) -> Column

Mirrors pyspark.sql.column.Column.__or__.

Source

pub fn not(self) -> Column

Mirrors pyspark.sql.column.Column.__invert__.

Source

pub fn neg(self) -> Column

Mirrors pyspark.sql.column.Column.__neg__.

Trait Implementations§

Source§

impl Add for Column

Source§

type Output = Column

The resulting type after applying the + operator.
Source§

fn add(self, other: Column) -> Column

Performs the + operation. Read more
Source§

impl BitAnd for Column

Source§

type Output = Column

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Column) -> Column

Performs the & operation. Read more
Source§

impl BitOr for Column

Source§

type Output = Column

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Column) -> Column

Performs the | operation. Read more
Source§

impl Clone for Column

Source§

fn clone(&self) -> Column

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 Column

Source§

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

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

impl Div for Column

Source§

type Output = Column

The resulting type after applying the / operator.
Source§

fn div(self, other: Column) -> Column

Performs the / operation. Read more
Source§

impl From<&String> for Column

Source§

fn from(name: &String) -> Column

Converts to this type from the input type.
Source§

impl From<&str> for Column

Source§

fn from(name: &str) -> Column

Converts to this type from the input type.
Source§

impl From<String> for Column

Source§

fn from(name: String) -> Column

Converts to this type from the input type.
Source§

impl Mul for Column

Source§

type Output = Column

The resulting type after applying the * operator.
Source§

fn mul(self, other: Column) -> Column

Performs the * operation. Read more
Source§

impl Not for Column

Source§

type Output = Column

The resulting type after applying the ! operator.
Source§

fn not(self) -> Column

Performs the unary ! operation. Read more
Source§

impl PartialEq for Column

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Rem for Column

Source§

type Output = Column

The resulting type after applying the % operator.
Source§

fn rem(self, other: Column) -> Column

Performs the % operation. Read more
Source§

impl StructuralPartialEq for Column

Source§

impl Sub for Column

Source§

type Output = Column

The resulting type after applying the - operator.
Source§

fn sub(self, other: Column) -> Column

Performs the - operation. Read more

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, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

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