Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View with parameters in BigQuery

We have a set of events (kind of log) that we want to connect to get the current state. To improve performance/cost further, we would like to create snapshots (in order to not check all the events in history, but only from the last snapshot). Logs and snapshots are the tables with date suffix.

This approach works OK in the BQ, but we need to manually define the query every time. Is there any way to define 'view' with parameters (e.g. dates for the table range query)? Or any plans to do something like that?

I know that there are some topics connected with TABLE_RANGE / QUERY in views (eg Use of TABLE_DATE_RANGE function in Views). Are there any new information on this subject?

like image 276
Roland Plaszowski Avatar asked Oct 06 '14 13:10

Roland Plaszowski


2 Answers

That's a great feature request - but currently not supported. Please leave more details at https://code.google.com/p/google-bigquery/issues/list, the BigQuery team takes these requests very seriously!

like image 159
Felipe Hoffa Avatar answered Oct 19 '22 13:10

Felipe Hoffa


As a workaround i wrote a small framework to generate complex queries with help of velocity templates. Just published it at https://github.com/softkot/gbq

like image 42
Alexei Volkov Avatar answered Oct 19 '22 12:10

Alexei Volkov