← rename operator page · clause/rename/multiple/manual_ex_1

Manual example 1 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

rename Me_1 to Me_2, At_1 to At_2: a measure and an attribute renamed in one clause.

Manual:

Change of Component name, Example 1, output verbatim: "The operator assigns new names to one or more Components (Identifier, Measure or Attribute Components)", and "Only the Component name is changed and not the Component Values".

Expected:

The same data points, with Me_2 and At_2 in place of Me_1 and At_1, with their roles and types.

script.vtl ⇩

DS_r := DS_1 [ rename Me_1 to Me_2, At_1 to At_2];

input/DS_1.csv ⇩

Id_1Id_2Id_3Me_1At_1
1BXX20F
1BYY1F
2AXX4E
2AYY9F

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": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
        {"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Id_2Id_3Me_2At_2
1BXX20F
1BYY1F
2AXX4E
2AYY9F

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier"},
        {"name": "Id_2", "type": "String", "role": "Identifier"},
        {"name": "Id_3", "type": "String", "role": "Identifier"},
        {"name": "Me_2", "type": "Integer", "role": "Measure"},
        {"name": "At_2", "type": "String", "role": "Attribute"}
      ]
    }
  ]
}