Data Analytics

BigQuery - Advanced Features

Partitioning, clustering, materialized views, UDFs, nested queries, STRUCT, ARRAY

20 interview questionsยท
Mid-Level
1

What is the primary role of partitioning in BigQuery?

Answer

Partitioning divides a table into segments based on a column (often a date), which reduces the amount of data scanned during queries. When a query filters on the partition column, BigQuery only reads the relevant partitions instead of scanning the entire table. This improves performance and reduces query costs, which are billed based on the volume of data scanned.

2

What types of partitioning are available in BigQuery?

Answer

BigQuery offers three types of partitioning: by DATE, TIMESTAMP, or DATETIME column (most common), by integer range (INTEGER RANGE), and by ingestion time (_PARTITIONTIME). Date-based partitioning is the most widely used because most analyses filter on time periods. Integer range partitioning is useful for numeric identifiers.

3

What is a STRUCT in BigQuery?

Answer

A STRUCT (or RECORD) is a data type that groups multiple named fields of potentially different types into a single column. For example, a STRUCT can contain a name (STRING), an age (INT64), and an email (STRING). STRUCTs allow modeling hierarchical data directly within a table, avoiding costly joins. Fields are accessed using dot notation (struct_col.field).

4

What is an ARRAY in BigQuery?

5

What is the purpose of the UNNEST function in BigQuery?

+17 interview questions

Master Data Analytics for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free