rename_col

Aliases: colrename (deprecated).

rename_col [columnbinding: expression]+

Renames existing columns while keeping the full row shape, using newName:@.oldName bindings evaluated so simultaneous swaps and chained renames compose in one step.

Only simple single-column paths on the default dataset are allowed; qualified dataset paths are rejected. Each source column may be renamed at most once, and each destination name must be unique. Renaming cannot target virtual link columns—use set_link for those. Overwriting an existing column name that is not also a source removes that column first; the compiler blocks overwrites of valid-from and valid-to columns (change time roles with set_valid_from or set_valid_to first) and blocks overwriting primary-key columns on resources.

Output column order and non-renamed columns match the input aside from the renames and any columns removed by overwrite. Sort metadata that references renamed columns is updated to the new names.

Categories

Accelerable

rename_col is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.

Examples

rename_col city_name:city, elev_m:elevation_ft, station_key:station_id

Renames three identifiers while every other column (such as temperature_c) is kept under its original name in the projected row.