DataFrame.withColumns
Adds or replaces several columns in one pass. The semantics are sequential withColumn over the array: an existing name is replaced at its own position, a new name is appended in batch order, and when the batch itself carries a duplicate name the last one wins. An empty batch returns the same frame. Heights are validated before anything is exposed.
Parameters
cols | the columns to add or replace, applied in array order |
Returns
the widened or updated frame.
Throws
DataFrameException when a column's height differs from
the frame's (or the batch heights differ on an empty frame).