BigQuery

BigQuery is an OLAP engine. It performs better on denormalized tables with nested and repeated data.

τ=dom∣⟨A1:τ[∗∣?],...,An:τ[∗∣?]i⟩∣τ = dom | \langle A_1 : τ [∗|?], . . . , A_n : τ [∗|?]i \rangle |

Dremel - https://storage.googleapis.com/pub-tools-public-publication-data/pdf/36632.pdf

Finite State Machine
Record Assembly
System architecture
Dissecting a record

Query Execution detail

Operation

Code plan

READ

$3:elapsed_time_sec, $4:event_type, $1:away_division_alias, $2:home_division_aliasFROM bigquery-public-data.ncaa_basketball.mbb_pbp_srWHERE and(equal($2, 'D1'), equal($1, 'D1'))

AGGREGATE

$30 := COUNTIF($40)$31 := COUNTIF($41)$32 := COUNTIF($42)$33 := COUNTIF($43)

COMPUTE

$40 := and(equal($4, 'threepointmade'), less($3, 2100))$41 := and(or(equal($4, 'threepointmade'), equal($4, 'threepointmiss')), less($3, 2100))$42 := and(equal($4, 'threepointmade'), greater_or_equal($3, 2100))$43 := and(or(equal($4, 'threepointmade'), equal($4, 'threepointmiss')), greater_or_equal($3, 2100))

WRITE

$30, $31, $32, $33TO __stage00_output

Working query

Importing data from Kafka

Run the imports and batch loads from Kafka into BigQuery through Apache Beam

Arrays

.https://cloud.google.com/bigquery/docs/reference/standard-sql/arrays

.https://google.qwiklabs.com/focuses/3638 - Troubleshooting Join pitfalls

Partition

BQML

.https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-predict

GIS

.https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions

External data sources

.https://cloud.google.com/bigquery/external-data-sources

Can query data directly from

  • Cloud Bigtable

  • Cloud Storage

  • Google Drive

  • Cloud SQL

Supported formats Avro, CSV, JSON (newline delimited), ORC, Parquet

Location of dataset

.https://cloud.google.com/bigquery/docs/locations

Query execution patterns

Statistics

.https://cloud.google.com/bigquery/docs/reference/standard-sql/statistical_aggregate_functions

Metrics

.https://console.cloud.google.com/apis/api/bigquery.googleapis.com/metrics?project=

Labs

name

quest link

BigQuery for data warehousing

More

Long running Queries

.https://cloud.google.com/service-infrastructure/docs/polling-operations

Structs

.https://cloud.google.com/spanner/docs/structs

WHERE vs HAVING

Last updated

Was this helpful?