Share via


Column.When(Column, Object) Method

Definition

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.

public Microsoft.Spark.Sql.Column When (Microsoft.Spark.Sql.Column condition, object value);
member this.When : Microsoft.Spark.Sql.Column * obj -> Microsoft.Spark.Sql.Column
Public Function When (condition As Column, value As Object) As Column

Parameters

condition
Column

The condition to check

value
Object

The value to set if the condition is true

Returns

New column after applying the when method

Applies to