Skip to content

FH09 — unionAll branches with mismatched shape

Group: Structure · Severity: error · Run by: validate and lint

All branches of a unionAll must produce the same column names in the same order, so the union has a single well-defined shape. Branches whose shapes disagree are rejected.

The two branches name their column a and b — FH09:

{
"resource": "Patient",
"select": [{ "unionAll": [
{ "column": [{ "name": "a", "path": "id" }] },
{ "column": [{ "name": "b", "path": "id" }] }
] }]
}
error [FH09]: unionAll branches have mismatched column shape (same names in the
same order required)

Make every branch emit the same column names in the same order (the paths may differ — only the names and order must match):

"unionAll": [
{ "column": [{ "name": "a", "path": "id" }] },
{ "column": [{ "name": "a", "path": "name.given" }] }
]