lit
: A new Column is created to represent the literal value.
If the parameter is a Column, it is returned unchanged.
bitwiseNOT
: Computes bitwise NOT.
coalesce
: Returns the first column that is not NA, or NA if all inputs are.
isnan
: Returns true if the column is NaN.
is.nan
: Alias for isnan.
monotonically_increasing_id
: Returns a column that generates monotonically increasing
64-bit integers. The generated ID is guaranteed to be monotonically increasing and unique,
but not consecutive. The current implementation puts the partition ID in the upper 31 bits,
and the record number within each partition in the lower 33 bits. The assumption is that the
SparkDataFrame has less than 1 billion partitions, and each partition has less than 8 billion
records. As an example, consider a SparkDataFrame with two partitions, each with 3 records.
This expression would return the following IDs:
0, 1, 2, 8589934592 (1L << 33), 8589934593, 8589934594.
This is equivalent to the MONOTONICALLY_INCREASING_ID function in SQL.
The method should be used with no argument.
Note: the function is non-deterministic because its result depends on partition IDs.
negate
: Unary minus, i.e. negate the expression.
spark_partition_id
: Returns the partition ID as a SparkDataFrame column.
Note that this is nondeterministic because it depends on data partitioning and
task scheduling.
This is equivalent to the SPARK_PARTITION_ID
function in SQL.
struct
: Creates a new struct column that composes multiple input columns.
nanvl
: Returns the first column (y
) if it is not NaN, or the second column
(x
) if the first column is NaN. Both inputs should be floating point columns
(DoubleType or FloatType).
greatest
: Returns the greatest value of the list of column names, skipping null values.
This function takes at least 2 parameters. It will return null if all parameters are null.
least
: Returns the least value of the list of column names, skipping null values.
This function takes at least 2 parameters. It will return null if all parameters are null.
expr
: Parses the expression string into the column that it represents, similar to
SparkDataFrame.selectExpr
rand
: Generates a random column with independent and identically distributed (i.i.d.)
samples uniformly distributed in [0.0, 1.0).
Note: the function is non-deterministic in general case.
randn
: Generates a column with independent and identically distributed (i.i.d.) samples
from the standard normal distribution.
Note: the function is non-deterministic in general case.
when
: Evaluates a list of conditions and returns one of multiple possible result
expressions. For unmatched expressions null is returned.
ifelse
: Evaluates a list of conditions and returns yes
if the conditions are
satisfied. Otherwise no
is returned for unmatched conditions.
create_array
: Creates a new array column. The input columns must all have the same data
type.
create_map
: Creates a new map column. The input columns must be grouped as key-value
pairs, e.g. (key1, value1, key2, value2, ...).
The key columns must all have the same data type, and can't be null.
The value columns must all have the same data type.
input_file_name
: Creates a string column with the input file name for a given row.
The method should be used with no argument.