DataFrame.WithColumn(String, Column) Method

Definition

Returns a new DataFrame by adding a column or replacing the existing column that has the same name.

public Microsoft.Spark.Sql.DataFrame WithColumn (string colName, Microsoft.Spark.Sql.Column col);
member this.WithColumn : string * Microsoft.Spark.Sql.Column -> Microsoft.Spark.Sql.DataFrame
Public Function WithColumn (colName As String, col As Column) As DataFrame

Parameters

colName
String

Name of the new column

col
Column

Column expression for the new column

Returns

DataFrame

DataFrame object

Applies to