Description
Tim Bradgate found this
SELECT RAW c FROM 1 AS d UNNEST ARRAY_EXCEPT([1,2,3,4,5],[2,4]) AS c; |
[1,3,5,null,null] vs [1,3,5] |
SELECT ARRAY_EXCEPT([1,2,3,4,5],[2,4]) ; |
returns [1,3,5] |
ARRAY_EXCEPT() evaluated twice once during planner
and second time during execution. Why planner results replaced first argument?
Same thing can happen non constants.
WITH o AS ([2,4]) |
SELECT RAW c
|
FROM [{"a":[1,2,3,4,5]}] AS d |
UNNEST ARRAY_EXCEPT(d.a,o) AS c;
|
Attachments
For Gerrit Dashboard: MB-50488 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
169162,2 | MB-50488. Don't alter First argument | master | query | Status: MERGED | +2 | +1 |
169167,2 | MB-50488. Don't alter First argument | master | query | Status: MERGED | +2 | +1 |