rename_columns_from_mapping
Rename columns in a table using a mapping table that pairs old names with new ones. Appends the rename step to the M query and ignores missing columns.
Instructions
Rename columns from a CONTROL TABLE: Table.RenameColumns(prev, Table.ToRows(...), MissingField.Ignore). Drives renames from a maintained {oldCol, newCol} mapping query; MissingField.Ignore skips columns that are absent. Appends one step to the table's M query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| newCol | Yes | the mapping column holding the NEW names | |
| oldCol | Yes | the mapping column holding the OLD names | |
| sessionId | Yes | ||
| mappingTable | Yes | the mapping query/table name | |
| partitionName | No | partition name (optional; defaults to the first partition) |