NULL positions participate in row identity for set operations.
highlighted = computed this step
NULL rows have identity
For set operations, this tiny model treats two rows with NULL in the same positions as the same row identity.
NULL position matters
Deduplicate NULL rows
The result has 3 rows after deduplication.
result rows=3
Set-operation examples are tiny finite bag transforms; SQL dialect details, type coercion, collations, ordering clauses, performance, and product behavior are out of scope.
Read the count table
The duplicate NULL row is counted, then UNION keeps one copy.
NULL row counted
Summary
This is row identity for set operations, not WHERE predicate truth.