GCM
GCM

Reputation: 19

How to stop a rouge queries inflating your billing when using BigQuery

Is there a way to automatically kill/stop a query if its taking more than specified resources (either in terms of time or number of rows/data to be scanned) ?

Thanks Gour

Upvotes: 1

Views: 402

Answers (1)

Pentium10
Pentium10

Reputation: 208002

There is a documentation page about BigQuery Best Practices: Controlling Costs which described all methods:

  • Avoid SELECT *
  • Sample data using preview options
  • Price your queries before running them with dry-run before
  • Limit query costs by restricting the number of bytes billed
  • View costs using a dashboard and query your audit logs
  • other methods on the docs page, such as partitioning, clustering etc...

but essentially you can program on the dry-run or the number of bytes billed feature to stop execution.

Upvotes: 2

Related Questions