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
Hi, I am building a query for BigQuery with union all and I am facing the following issue:
If I just pass the queries as input to union-all, those queries are not considered nested and there are no wrapping parens ( cause a syntax error on execution )
If I wrap each query with {:nest q}, then it wraps it twice. First due to the explicit nest and second because it is a nested query.
Not sure if I am missing something here.
As a simple way to reproduce this : {:nest (h/select :*)}
Produces "((SELECT *))"
And in union all context:
(h/union-all
{:nest (h/select :* )}
{:nest (h/select :* )})
=> ((SELECT *)) UNION ALL ((SELECT *))
(h/union-all
(h/select :* )
(h/select :* ))
=> SELECT * UNION ALL SELECT *
Is there a way to achieve single wrapping? Can the union-all consider its params as nested queries?
The text was updated successfully, but these errors were encountered:
Looks like my fix for #370 was a bit over-zealous. The syntax without nesting is correct for most databases (and if you do wrap the selects in parentheses, it is a syntax error for some databases) so it's unfortunate that BigQuery seems to require parentheses.
I'll get this fixed in the next few days and cut a new release.
Hi, I am building a query for BigQuery with union all and I am facing the following issue:
Not sure if I am missing something here.
As a simple way to reproduce this :
{:nest (h/select :*)}
Produces "((SELECT *))"
And in union all context:
Is there a way to achieve single wrapping? Can the union-all consider its params as nested queries?
The text was updated successfully, but these errors were encountered: