Skip to main content
These settings are available in system.settings and are autogenerated from source.

bigquery_storage_read_api_filter_push_down

When reading from BigQuery through the Storage Read API (bigquery_use_storage_read_api), send the conditions of WHERE that BigQuery evaluates the same way as ClickHouse to BigQuery as the row restriction of the read session, so that BigQuery returns only the rows that satisfy them and skips the partitions and clustered blocks that have none. These are comparisons of a column with a constant (=, !=, <, <=, >, >=, IN, NOT IN, IS NULL, IS NOT NULL) for columns of the types INT64, FLOAT64, BOOL, STRING (without a collation), DATE, DATETIME, TIMESTAMP, NUMERIC and BIGNUMERIC, combined with AND, OR and NOT. The whole condition is still evaluated by ClickHouse, so a condition that is not sent only means that more rows are read. EXPLAIN actions = 1 shows the row restriction of a query.

bigquery_use_storage_read_api

Read from BigQuery (the bigquery table function and the BigQuery table engine) through the BigQuery Storage Read API instead of the tabledata.list method of the REST API. The Storage Read API returns the rows as Arrow record batches over several streams that are read in parallel, at most as many as the query has threads for. Only the columns the query uses are read, and the conditions of WHERE that BigQuery evaluates the same way as ClickHouse are sent to BigQuery (see bigquery_storage_read_api_filter_push_down), which uses them to skip partitions and clustered blocks. It is much faster than tabledata.list, which returns the rows as JSON through one sequential cursor. The Storage Read API has requirements that tabledata.list does not have:
  • The credentials need the permission bigquery.readsessions.create (the role roles/bigquery.readSessionUser) on the project the read session is created in. It is the billing project: the billing_project argument, by default the project of the service account, or else the project of the table.
  • The data read is billed to that project, while tabledata.list is free of charge.
  • INTERVAL and RANGE columns cannot be read.
The number of read sessions, the number of streams and the size of the data that BigQuery estimates the sessions to scan are available as the profile events BigQueryStorageReadSessions, BigQueryStorageReadStreams and BigQueryStorageReadEstimatedBytesScanned.