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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"table": "<table>",
"mappingTable": "<mappingTable>",
"oldCol": "<oldCol>",
"newCol": "<newCol>"
},
"name": "rename_columns_from_mapping"
}
}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) |