How to perform a dry run of a query so as to get a cost estimate of the query beforehand?

0 votes
How to perform a dry run of a query so as to get a cost estimate of the query beforehand? How can I do this using command line?
Nov 21 in GCP by anonymous
• 6,650 points
16 views

1 answer to this question.

0 votes

To perform a dry run:

Enter a query like the following using the --dry_run flag.

bq query \
--use_legacy_sql=false \
--dry_run \
'SELECT
   COUNTRY,
   AIRPORT,
   IATA
 FROM
   `project_id`.dataset.airports
 LIMIT
   1000'

The command produces the following response:

Query successfully validated. Assuming the tables are not modified,
running this query will process 10918 bytes of data.
answered Nov 21 by Sirajul
• 40,980 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

How do I create a BigQuery Dataset using the console?

To create a dataset: Open the BigQuery web ...READ MORE

answered Nov 15 in GCP by anonymous
• 40,980 points
23 views
0 votes
1 answer

Assign access control to a BigQuery Dataset.

You can apply access controls during dataset creation by ...READ MORE

answered Nov 15 in GCP by Sirajul
• 40,980 points
29 views
0 votes
1 answer

Permissions required to update a dataset.

At a minimum, to update dataset properties, ...READ MORE

answered Nov 15 in GCP by Sirajul
• 40,980 points
31 views
0 votes
1 answer

Change default expiration time for a dataset.

You can update a dataset's default table ...READ MORE

answered Nov 15 in GCP by Sirajul
• 40,980 points
28 views
0 votes
1 answer