Multiplication of this expression a constant.
Multiplication of this expression a constant.
// The following multiplies a person's height by their weight.
people.select( people.col('height) * people.col('weight) )
apache/spark
Multiplication of this expression and another expression.
Multiplication of this expression and another expression.
// The following multiplies a person's height by their weight.
people.select( people.col('height) * people.col('weight) )
apache/spark
Sum of this expression (column) with a constant.
Sum of this expression (column) with a constant.
// The following selects the sum of a person's height and weight. people.select( people('height) + 2 )
a constant of the same type apache/spark
Sum of this expression and another expression.
Sum of this expression and another expression.
// The following selects the sum of a person's height and weight.
people.select( people.col('height) + people.col('weight) )
apache/spark
Subtraction.
Subtraction. Subtract the other expression from this expression.
// The following selects the difference between people's height and their weight. people.select( people('height) - 1 )
a constant of the same type apache/spark
Subtraction.
Subtraction. Subtract the other expression from this expression.
// The following selects the difference between people's height and their weight.
people.select( people.col('height) - people.col('weight) )
apache/spark
Division this expression by another expression.
Division this expression by another expression.
// The following divides a person's height by their weight. people.select( people('height) / 2 )
a constant of the same type apache/spark
Division this expression by another expression.
Division this expression by another expression.
// The following divides a person's height by their weight.
people.select( people('height) / people('weight) )
another column of the same type apache/spark
Equality test.
Equality test.
df.filter( df.col('a) === df.col('b) )
apache/spark
Equality test.
Equality test.
df.filter( df.col('a) === 1 )
apache/spark
Casts the column to a different type.
Casts the column to a different type.
df.select(df('a).cast[Int])
Division this expression by another expression.
Division this expression by another expression.
// The following divides a person's height by their weight.
people.select( people('height) / people('weight) )
another column of the same type apache/spark
Subtraction.
Subtraction. Subtract the other expression from this expression.
// The following selects the difference between people's height and their weight.
people.select( people.col('height) minus people.col('weight) )
apache/spark
Multiplication of this expression and another expression.
Multiplication of this expression and another expression.
// The following multiplies a person's height by their weight.
people.select( people.col('height) multiply people.col('weight) )
apache/spark
Sum of this expression and another expression.
Sum of this expression and another expression.
// The following selects the sum of a person's height and weight.
people.select( people.col('height) plus people.col('weight) )
apache/spark
Unary minus, i.e.
Unary minus, i.e. negate the expression.
// Select the amount column and negates all values.
df.select( -df('amount) )
apache/spark
Fall back to an untyped Column
Fall back to an untyped Column
Expression used both in
groupBy
andselect
-like constructions.type of dataset
type of column for
groupBy
type of column for
select