fpopic
fpopic

Reputation: 1808

Executing existing parametrised BigQuery view from bq cmd tool

How to execute the existing BigQuery parametrized view with passing parameters (@param) without sending the view query as well?

I would like to execute existing view with placeholders for my custom parameters.

My minimalistic view saved in BigQuery in project.dataset.view:

select * from `project.dataset.table`  
where column = @x

My bq cmd looks like:

bq --location=EU query --use_legacy_sql=False \
--parameter='x:INT64:100' \
--destination_table="dev.view_result" "[HERE IS THE SAME VIEW COPIED]"

Like that I am not executing the existing view, I am creating a new select query (new view).

Is it possible to call it somehow like:

bq --location=EU query --use_legacy_sql=False \
--parameter='x:INT64:100' \
--destination_table="dataset.view_result"
--view=[VIEW_URL like dataset.view]

Upvotes: 1

Views: 1065

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172964

Views with parameters are not supported in BigQuery yet - see relatedfeature request

Upvotes: 2

Related Questions