nerdexam
Google

PROFESSIONAL-DATA-ENGINEER · Question #139

You have enabled the free integration between Firebase Analytics and Google BigQuery. Firebase now automatically creates a new table daily in BigQuery in the format app_events_YYYYMMDD. You want to…

Legacy SQL in BigQuery uses the TABLE_DATE_RANGE function to query across multiple date-sharded tables by specifying a date range and table prefix.

Submitted by takeshi77· Mar 30, 2026Building and operationalizing data processing systems

Question

You have enabled the free integration between Firebase Analytics and Google BigQuery. Firebase now automatically creates a new table daily in BigQuery in the format app_events_YYYYMMDD. You want to query all of the tables for the past 30 days in legacy SQL. What should you do?

Options

  • AUse the TABLE_DATE_RANGE function
  • BUse the WHERE_PARTITIONTIME pseudo column

Why each option

Legacy SQL in BigQuery uses the TABLE_DATE_RANGE function to query across multiple date-sharded tables by specifying a date range and table prefix.

AUse the TABLE_DATE_RANGE function
BUse the WHERE_PARTITIONTIME pseudo column

The _PARTITIONTIME pseudo column is a Standard SQL feature used to filter rows within a single date-partitioned table; it is not applicable to Legacy SQL or to the date-sharded table pattern used by Firebase BigQuery exports.

Concept tested: Legacy SQL TABLE_DATE_RANGE for date-sharded table queries

Source: https://cloud.google.com/bigquery/docs/reference/legacy-sql#table_date_range

Topics

#BigQuery#legacy SQL#TABLE_DATE_RANGE#date-sharded tables

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice