flatten

Edit pageLast modified: 02 June 2025

Returns DataFrame without column groupings under selected columns.

Columns will keep their original names after flattening. Potential column name clashes are resolved by adding minimal possible name prefix from ancestor columns.

See column selectors for how to select the columns for this operation.

// name.firstName -> firstName
// name.lastName -> lastName
df.flatten { name }

To remove all column groupings in DataFrame, invoke flatten without parameters: