Skip to content
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

[BUG] Quoted column names fails on bigquery #42

Open
ablack3 opened this issue Apr 28, 2023 · 2 comments
Open

[BUG] Quoted column names fails on bigquery #42

ablack3 opened this issue Apr 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ablack3
Copy link

ablack3 commented Apr 28, 2023

Describe the bug
Quoting column names as done in here causes an error on bigquery. In general I don't think SqlRender supports quoted column names. I'm not sure this is documented anywhere but after talking with @schuemie this is my understanding. To discover the error you would need to run your code on BigQuery.

To Reproduce
Run any SQL that quotes column names with double quotes on bigquery using DatabaseConnector and SqlRender.

Screenshots

image

My suggestion would be to remove quotes around column names from all OHDSI-SQL.

@ablack3 ablack3 added the bug Something isn't working label Apr 28, 2023
@ablack3
Copy link
Author

ablack3 commented Apr 28, 2023

I'm also getting this error. 1024 characters does not seem like a lot. @schuemie Have you seen this before? The stratified person sql query is around 1075 characters.

image

image

Ah, I think you are splicing a large number of person_ids into the query and it is making the query too long.

@schuemie
Copy link
Contributor

schuemie commented May 8, 2023

  1. Yes, don't use quotes for column names. That makes them very hard to port across database platforms.
  2. Many platforms have issues when an IN clause contains too many items. As a general rule of thumb, if the list of items may exceed 100, upload a temp table and join with that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants