Chapter 7Running Queries

This chapter describes how to run queries in BigQuery—from how to send the API requests to how to construct valid queries in the BigQuery variant of SQL. The chapter is divided into two sections: query API and query language.

The query API section describes the mechanics of how to run queries. If you do not intend to write code to interact with the BigQuery API, you might want to skim this section rather than skip it completely; it has information about what is possible via the underlying API, which might come in handy even if you're going to use only a web interface or command-line client to interact with BigQuery.

The query language section describes the features of BigQuery SQL. It assumes some familiarity with writing SQL queries and does not attempt to be an in-depth query reference. It does, however, walk through simple query creation and focus on differences between BigQuery and standard SQL.

After reading this chapter you should know everything you need to know to construct and run simple queries in BigQuery. Understanding how the query engine works at a high level is key to getting the most out of BigQuery queries. For this reason, more advanced query topics are deferred until Chapter 10, “Advanced Queries,” after the query architecture has been explained.

BigQuery Query API

As discussed in Chapter 5, “Talking to the BigQuery API,” all BigQuery queries are jobs. Because they are jobs, they execute asynchronously; you can decouple the act of ...

Get Google BigQuery Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.