← rename operator page · clause/rename/basic/identifier_renamed

Identifier renamed 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

rename Id_2 to Id_3: an identifier renamed, where Manual example 1 of the multiple form renames a measure and an attribute.

Manual:

Change of Component name: "The operator assigns new names to one or more Components (Identifier, Measure or Attribute Components)."

Expected:

Id_3 stays an Identifier of type String, with the values of Id_2: A and B.

script.vtl ⇩

DS_r := DS_1 [ rename Id_2 to Id_3 ];

input/DS_1.csv ⇩

Id_1Id_2Me_1
1A10
1B20

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
        {"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Id_3Me_1
1A10
1B20

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier"},
        {"name": "Id_3", "type": "String", "role": "Identifier"},
        {"name": "Me_1", "type": "Integer", "role": "Measure"}
      ]
    }
  ]
}