← rename operator page · clause/rename/basic/new_name_already_in_operand
pandas ✅ · DuckDB ✅
rename Me_1 to Me_2, on a data set that already has the measure Me_2: the first error condition that the page states.
Change of Component name: "the component used in the dsc_to cannot have the same names as other Components of the result Data Set".
The error 1-1-6-8, "Cannot use component {comp_name} for rename, it is already in the Dataset {dataset_name}.", for "The resulting Data Set, after renaming the specified Components, must have unique names of all its Components (otherwise a runtime error is raised)": the result would have two components named Me_2. The page calls it a runtime error, but a name clash is a condition on the structures alone, so vtlengine raises it as a SemanticError and no 2-* message states it.
DS_r := DS_1 [ rename Me_1 to Me_2 ];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 10 | 100 |
| 2 | 20 | 200 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
{"code": "1-1-6-8"}