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;
|