-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bigquery: GROUP BY error #249
Comments
@mgkahn Thank you for asking. Let us check and to propose solution. |
SqlRender currently does not process correctly numbers less or equal to number of arguments in select statement. Or you can move case statement into inner select. Something like this:
|
I am confused by this answer. The issue is the GROUP BY arguments not the CASE statement. SQLRender translate the GROUP BY as 2,3 rather than 2,1 like is done correctly for Postgres. Are you saying the CASE statement throws off the GROUP BY translation? Thanks for looking into this more. |
No, it's bug in SqlRender. |
Thank you for the further insights. Not to be annoying but one last question (maybe!): why does the translation work correctly for Postgres but not BG. If I understand your explanation, the mis-processing should occur in both translations since it seems to be a DBMS independent part of the code. Why BigQuery specific? |
BigQuery uses its own translation mechanism due to differences of their dialects |
This is a problem for us as well. Because AllOfUs uses bigquery and we use AoU. see replacement on a simple example Why can't group by be kept as is and is changed to numbers? What replacement pattern (what row in that pattern file) is doing that change? (or what other process besides the pattern file) |
@ schumie |
Two screenshots from SqlRender Developer showing GROUP BY arguments mapped incorrectly for BigQuery. Second screenshot shows me replacing column names with column numbers and the mapping is still incorrect. Postgres mapping was correct for both constructs. As best as my limited understanding allows, I do not think this is an error in the rewrite patterns but somewhere deep in the BG-specific java parsing code, well beyond me. If anybody has a suggestion how to rewrite the original (first screenshot/top panel) to process correctly thru TRANSLATE, please let me know.
Thanks, Michael
The text was updated successfully, but these errors were encountered: