RenameDocs
Renames the specified columns keeping their original values and location within the DataFrame.
This function does not immediately rename the columns but instead selects columns to rename and returns a RenameClause, which serves as an intermediate step. The RenameClause object provides methods to rename selected columns using:
to(name)- renames selected columns to the specified names.to { nameExpression }- renames selected columns using a provided expression assuming column with its path and returning a new name.toCamelCase()- renames all selected columns to "camelCase".
Each method returns a new DataFrame with the renamed columns.
Check out Grammar.
This can include column groups and nested columns.
See Selecting Columns.
For more information: See rename on the documentation website.
See also renameToCamelCase which renames all columns to "camelCase" format.
Types
Selecting columns for various DataFrame operations can be done in the following ways: