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 a primitive collection has a LINQ operator composed on top of it, we convert it to a rowset via unnest, insert it via a lateral join into the query, and then process the query as usual:
SELECT b."Id", i.value+1, i.ordinalityFROM"Blogs"AS b
LEFT JOIN LATERAL unnest(b."Ints") WITH ORDINALITY AS i(value) ON TRUE
ORDER BY b."Id"-- currently missing ordinality, #3207
Instead, we could simply use the array constructor operator to convert the subquery directly into an array:
SELECT ARRAY(SELECT i +1FROM unnest(b."Ints"))
FROM"Blogs"AS b
The tricky part here is to figure out exactly when to wrap the subquery in ARRAY(), as opposed to when to leave the classical relational translation with lateral join.
The text was updated successfully, but these errors were encountered:
When a primitive collection has a LINQ operator composed on top of it, we convert it to a rowset via unnest, insert it via a lateral join into the query, and then process the query as usual:
Current SQL:
Instead, we could simply use the array constructor operator to convert the subquery directly into an array:
The tricky part here is to figure out exactly when to wrap the subquery in ARRAY(), as opposed to when to leave the classical relational translation with lateral join.
The text was updated successfully, but these errors were encountered: