Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.9.4.1
-
None
Description
Simple unnest (",") should be equivalent to using UNNEST keyword. However a combination of simple unnest followed by JOIN produces incorrect result.
Consider these 3 queries which should return the same result (24 = 2*3*4):
Q1: (UNNEST then JOIN ON TRUE)
with t1 as [ { "x": 1, "y": [10, 11, 12] }, { "x": 2, "y": [20, 21, 22] } ], t2 as [ 100, 101, 102, 103 ] from t1 as t1 unnest t1.y as y join t2 as t2 on true select value count(*)
Correct: returns 24 as expected.
Q2: ("," then ",")
with t1 as [ { "x": 1, "y": [10, 11, 12] }, { "x": 2, "y": [20, 21, 22] } ], t2 as [ 100, 101, 102, 103 ] from t1 as t1, t1.y as y, t2 as t2 select value count(*)
Correct: returns 24 as expected.
Q3: ("," then JOIN ON TRUE)
with t1 as [ { "x": 1, "y": [10, 11, 12] }, { "x": 2, "y": [20, 21, 22] } ], t2 as [ 100, 101, 102, 103 ] from t1 as t1, t1.y as y join t2 as t2 on true select value count(*)
INCORRECT: returns 48
Attachments
Issue Links
- links to