← full_join operator page · join/full_join/calc_default/overwrite_identifier

Overwrite identifier 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

calc Id_2 := "X" with no role: the calculated component has the name of the identifier Id_2, which both operands have.

Manual:

Full Join: "If a generated component already exists in any of the input data sets, all input components homonymous to the former are removed, and only the generated component is kept".

Expected:

the error 1-1-6-13, "Not allowed to overwrite an Identifier: {comp_name}", for "if any of the removed components were identifiers, an error is raised": the calc would remove the identifier Id_2.

script.vtl ⇩

DS_r := full_join(DS_1, DS_2 calc Id_2 := "X");

input/DS_1.csv ⇩

Id_1Id_2Me_1
1A10
1B20
2A30
2B40

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": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

input/DS_2.csv ⇩

Id_1Id_2Me_2
1A1
1C2
2A3
2B4

input/DS_2.json ⇩

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

expected/error.json ⇩

{"code": "1-1-6-13"}