Support parameterized SQL in bigquery integration (bq_solid_for_queries)
See original GitHub issue@solid
def get_foo_id_list(_) -> List[str]:
return ['a', 'b', 'c']
bq_solid_for_queries([
f""" select * from my_table where id in {foo_id_list}"
]
I’d like to construct a SQL query using the output of an upstream solid. How would I do that?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Running parameterized queries | BigQuery - Google Cloud
BigQuery supports query parameters to help prevent SQL injection when queries are constructed using user input. This feature is only available with Google ......
Read more >Working With BigQuery Parameterized Queries: Made Easy 101
This write-up is going to look at Google BigQuery Parameterized Queries, explaining how it works to show that using parameters in your query ......
Read more >How To Run Parameterized Queries With Google BigQuery ...
BigQuery supports query parameters to help prevent SQL injection when queries are constructed using user input. In this Google BigQuery API ...
Read more >Use parameters in a custom query - Looker Studio Help
Parameters let you build more responsive, customizable reports. You can pass parameters in a data source back to the underlying query. To use...
Read more >BigQuery Parameterization - Jupyter Notebooks Gallery
Google BigQuery Standard SQL supports parameterization. It is interesting to be able to use Python variables defined in the notebook as parameter values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One way of addressing this would be with a
bigquery_solid
decorator. Thoughts?hey @zzztimbo thanks for checking!
Right now,
bq_solid_for_queries
is a solid factory, and expects the queries to be available at pipeline compilation time, vs. fed in as a Dagster input. If it’s possible to feed['a', 'b', 'c']
in non-Dagster Python code at pipeline construction time, you can try that.If you definitely need SQL to be an input to the solid, the below should work:
I’ll keep this issue open to track adding the above to the
dagster_gcp
library, since this seems like it should be functionality we provide out of the box.