Column Class

Definition

Column class represents a column that will be computed based on the data in a DataFrame.

public sealed class Column
type Column = class
Public NotInheritable Class Column
Inheritance
Column

Methods

Alias(String)

Gives the column an alias. Same as As().

And(Column)

Apply boolean AND operator with the given column.

Apply(Object)

Extracts a value or values from a complex type. The following types of extraction are supported:

  1. Given an Array, an integer ordinal can be used to retrieve a single value.
  2. Given a Map, a key of the correct type can be used to retrieve an individual value.
  3. Given a Struct, a string fieldName can be used to extract that field.
  4. Given an Array of Structs, a string fieldName can be used to extract field of every struct in that array, and return an Array of fields.
As(IEnumerable<String>)

Assigns the given aliases to the results of a table generating function.

As(String)

Gives the column an alias.

Asc()

Returns a sort expression based on ascending order of the column.

AscNullsFirst()

Returns a sort expression based on ascending order of the column, and null values return before non-null values.

AscNullsLast()

Returns a sort expression based on ascending order of the column, and null values appear after non-null values.

Between(Object, Object)

True if the current column is between the lower bound and upper bound, inclusive.

BitwiseAND(Object)

Compute bitwise AND of this expression with another expression.

BitwiseOR(Object)

Compute bitwise OR of this expression with another expression.

BitwiseXOR(Object)

Compute bitwise XOR of this expression with another expression.

Cast(String)

Casts the column to a different data type, using the canonical string representation of the type.

Contains(Object)

Contains the other element. Returns a boolean column based on a string match.

Desc()

Returns a sort expression based on ascending order of the column, and null values return before non-null values.

DescNullsFirst()

Returns a sort expression based on the descending order of the column, and null values appear before non-null values.

DescNullsLast()

Returns a sort expression based on the descending order of the column, and null values appear after non-null values.

Divide(Object)

Division of this expression by another expression.

EndsWith(Column)

String ends with. Returns a boolean column based on a string match.

EndsWith(String)

String ends with another string literal. Returns a boolean column based on a string match.

EqNullSafe(Object)

Apply equality test that is safe for null values.

Equals(Object)

Checks if the given object is equal to this object.

EqualTo(Object)

Equality test.

Explain(Boolean)

Prints the expression to the console for debugging purposes.

Geq(Object)

Greater or equal to.

GetField(String)

An expression that gets a field by name in a StructType.

GetHashCode()

Calculates the hash code for this object.

GetItem(Object)

An expression that gets an item at position ordinal out of an array, or gets a value by key key in a MapType.

Gt(Object)

Greater than.

IsIn(Boolean[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Decimal[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Double[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Int16[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Int32[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Int64[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(Single[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsIn(String[])

A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments.

IsNaN()

True if the current expression is NaN.

IsNotNull()

True if the current expression is NOT null.

IsNull()

True if the current expression is null.

Leq(Object)

Less than or equal to.

Like(String)

SQL like expression. Returns a boolean column based on a SQL LIKE match.

Lt(Object)

Less than.

Minus(Object)

Subtraction. Subtract the other expression from this expression.

Mod(Object)

Modulo (a.k.a remainder) expression.

Multiply(Object)

Multiplication of this expression and another expression.

Name(String)

Gives the column a name (alias).

NotEqual(Object)

Inequality test.

Or(Column)

Apply boolean OR operator with the given column.

Otherwise(Object)

Evaluates a list of conditions and returns one of multiple possible result expressions. If otherwise is not defined at the end, null is returned for unmatched conditions. This is used when the When(Column, object) method is applied.

Over()

Defines an empty analytic clause. In this case the analytic function is applied and presented for all rows in the result set.

Over(WindowSpec)

Defines a windowing column.

Plus(Object)

Sum of this expression and another expression.

RLike(String)

SQL RLIKE expression (LIKE with Regex). Returns a boolean column based on a regex match.

StartsWith(Column)

String starts with. Returns a boolean column based on a string match.

StartsWith(String)

String starts with another string literal. Returns a boolean column based on a string match.

SubStr(Column, Column)

An expression that returns a substring.

SubStr(Int32, Int32)

An expression that returns a substring.

ToString()

Invoke the toString method of the column instance

When(Column, Object)

Evaluates a condition and returns one of multiple possible result expressions. If Otherwise(object) is not defined at the end, null is returned for unmatched conditions. This method can be chained with other 'when' invocations in case multiple matches are required.

Operators

Addition(Column, Object)

Apply sum of two expressions.

BitwiseAnd(Column, Column)

Apply boolean AND operator for the given two columns.

BitwiseOr(Column, Column)

Apply boolean OR operator for the given two columns.

Division(Column, Object)

Apply division of two expressions.

Equality(Column, Object)

Apply equality test on the given two columns.

GreaterThan(Column, Object)

Apply "greater than" operator for the given two columns.

GreaterThanOrEqual(Column, Object)

Apply "greater than or equal to" operator for the given two columns.

Inequality(Column, Object)

Apply inequality test.

LessThan(Column, Object)

Apply "less than" operator for the given two columns.

LessThanOrEqual(Column, Object)

Apply "less than or equal to" operator for the given two columns.

LogicalNot(Column)

Apply inversion of boolean expression, i.e. NOT.

Modulus(Column, Object)

Apply division of two expressions.

Multiply(Column, Object)

Apply multiplication of two expressions.

Subtraction(Column, Object)

Apply subtraction of two expressions.

UnaryNegation(Column)

Negate the given column.

Applies to