Database Reference
In-Depth Information
FROM (
SELECT
primary_city,
SUM(population) AS city_total
FROM [bigquery-e2e:reference.zip_codes]
WHERE primary_city IN ('Bellevue', 'Kirkland',
'Seattle')
GROUP BY primary_city)
Refer to the BigQuery documentation for the list of currently supported
window functions. Over time this list is certainly going to grow and it is also
likely that some of the restrictions around the use of these functions will be
lifted. Even with their current limitations, they can greatly simplify many
data analysis tasks.
BigQuery SQL Extensions
As mentioned at length elsewhere, BigQuery SQL, like most
implementations, is not standard-compliant. Some of the differences
between standard SQL and BigQuery SQL are omissions or semantic
changes. However, other differences are extensions that BigQuery made
to the language because no standard exists for them, but they provide
significant power and expressivity to the query language. One such example
is the capability to query nested and repeated fields; this allows users to
store their data in a conceptually convenient way while also allowing the
data to be queried. There is no standard SQL way to query a field that is itself
a list of values. Other examples include special syntax for accessing a portion
of a table or hints that tell the query engine how to parallelize the query.
The EACH Keyword
The EACH keyword is an optimization hint to the query engine that tells it
to perform a shuffle operation. Chapter 10 has a detailed discussion of how
shuffle works, but the effect is that it sorts data so that it can be processed
in parallel. Note that this is only a hint: BigQuery may decide to shuffle data
without an EACH keyword, and the presence of an EACH keyword doesn't
guarantee that your data will be shuffled. In fact, at some point, we'd like to
eliminate the need for EACH entirely.
Search WWH ::




Custom Search