You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When joining with USING, the join planNode outputs only a "coalesced" column for each equality pair. This is incorrect for outer joins if we are specifically selecting a source column.
root@:26257>select*from a;
+---+---+
| k | v |
+---+---+
| 1 | 1 |
| 2 | 2 |
+---+---+
(2 rows)
root@:26257>select*from b;
+---+---+
| k | v |
+---+---+
| 3 | 3 |
| 4 | 4 |
+---+---+
(2 rows)
root@:26257>SELECT k, a.k, b.kFROM a FULL JOIN b USING (k);
+---+---+---+
| k | k | k |
+---+---+---+
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 4 | 4 | 4 |
| 3 | 3 | 3 |
+---+---+---+
The correct answer (verified on PG) should be:
SELECT k, a.k, b.kFROM a FULL OUTER JOIN b USING (k);
k | k | k
---+---+---1 | 1 |
2 | 2 |
3 | | 34 | | 4
(4 rows)
I think the join node should add the coalesced columns in addition to (not in lieu of) the original columns. The new infrastructure around omitted columns will allow us to avoid calculating any columns we don't need. Also see #12028 which suggests some refactoring which may be related.
The text was updated successfully, but these errors were encountered:
When joining with
USING
, the join planNode outputs only a "coalesced" column for each equality pair. This is incorrect for outer joins if we are specifically selecting a source column.The correct answer (verified on PG) should be:
I think the join node should add the coalesced columns in addition to (not in lieu of) the original columns. The new infrastructure around omitted columns will allow us to avoid calculating any columns we don't need. Also see #12028 which suggests some refactoring which may be related.
The text was updated successfully, but these errors were encountered: