← full_join operator page · join/full_join/nary/three_operands

Three operands 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

a full join of three operands with the same identifiers.

Manual:

Full Join: at each step "an additional data point is added to this set for each data point in the current join operand that wasn't matched before".

Expected:

the first step gives the five keys of DS_1 and DS_2, the second adds (3,A) of DS_3: six data points, each measure null where its operand lacks the key.

script.vtl ⇩

DS_r := full_join(DS_1, DS_2, DS_3);

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}
      ]
    }
  ]
}

input/DS_3.csv ⇩

Id_1Id_2Me_3
1A100
2B400
3A500

input/DS_3.json ⇩

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

expected/DS_r.csv ⇩

Id_1Id_2Me_1Me_2Me_3
1A101100
1B20
1C2
2A303
2B404400
3A500

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier"},
        {"name": "Id_2", "type": "String", "role": "Identifier"},
        {"name": "Me_1", "type": "Number", "role": "Measure"},
        {"name": "Me_2", "type": "Number", "role": "Measure"},
        {"name": "Me_3", "type": "Number", "role": "Measure"}
      ]
    }
  ]
}