Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.1.0
-
Untriaged
-
1
-
Unknown
Description
UPSERT INTO default values("k001",{"arr":[{"x":1}, {"x":2}, {"x":1}, {"x":1}]}); |
CREATE INDEX aix1 ON default(ALL ARRAY u.x FOR u IN arr END); |
CREATE INDEX aix1e ON default(ALL ARRAY u.x FOR u IN arr END, arr); |
The following query returns right results
SELECT u.x
|
FROM default AS d USE INDEX (aix1) |
UNNEST d.arr AS u
|
WHERE u.x > 0 |
ORDER BY u.x;
|
results
|
[
|
{ "x": 1 }, |
{ "x": 1 }, |
{ "x": 1 }, |
{ "x": 2 } |
]
|
The following query returns wrong results. The results should be same as above
SELECT u.x, d.c1
|
FROM default AS d USE INDEX (aix1) |
UNNEST d.arr AS u
|
WHERE u.x > 0 |
ORDER BY u.x;
|
results
|
[
|
{ "x": 1 }, |
{ "x": 2 }, |
{ "x": 1 }, |
{ "x": 1 } |
]
|
SELECT u.x
|
FROM default AS d USE INDEX (aix1e) |
UNNEST d.arr AS u
|
WHERE u.x > 0 |
ORDER BY u.x;
|
results
|
[
|
{ "x": 1 }, |
{ "x": 1 }, |
{ "x": 1 }, |
{ "x": 1 } |
]
|
Attachments
For Gerrit Dashboard: MB-51410 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
172157,2 | MB-51410. Disable pushdowns if Unnest operator present | master | query | Status: MERGED | +2 | +1 |
172927,2 | MB-51410 Add test case | master | query | Status: MERGED | +2 | +1 |