> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# BigQuery compatibility

> Run BigQuery GoogleSQL against Firebolt by switching the session dialect.

<span className="feature-tag">Preview</span>

BigQuery compatibility mode lets you run BigQuery [GoogleSQL](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax) against Firebolt without rewriting it. When the mode is on, Firebolt parses each statement with BigQuery grammar and translates it to native Firebolt SQL, so BigQuery query syntax, functions, and type names work as written.

Use it to point existing BigQuery queries and tools at Firebolt, and to migrate a workload incrementally: run the BigQuery SQL you already have, then adopt native Firebolt SQL where you want to.

## What works

* [Query syntax](/compatibility-modes/bigquery/query-syntax): `SELECT`, `FROM`, joins, `UNNEST`, set operations with `CORRESPONDING`, `QUALIFY`, `GROUP BY ALL`, `GROUPING SETS`, `ROLLUP`, `CUBE`, CTEs, and `SELECT * EXCEPT`.
* [Pipe syntax](/compatibility-modes/bigquery/pipe-syntax): the `|>` pipe operator, including `WHERE`, `SELECT`, `EXTEND`, `AGGREGATE`, `ORDER BY`, `LIMIT`, `JOIN`, and set operations.
* [Data types](/compatibility-modes/bigquery/data-types): `INT64`, `FLOAT64`, `NUMERIC`, `BOOL`, `STRING`, `BYTES`, `DATE`, `DATETIME`, `TIMESTAMP`, `GEOGRAPHY`, `JSON`, `ARRAY`, and `STRUCT`.
* [Operators](/compatibility-modes/bigquery/operators): arithmetic, comparison, and logical operators, `IS DISTINCT FROM`, `IN UNNEST`, JSON `->`, `ARRAY []`, and `AT TIME ZONE`.
* Functions:
  * [Date and time](/compatibility-modes/bigquery/functions/date-and-time): the `DATE_`, `DATETIME_`, `TIMESTAMP_`, `FORMAT_`, `PARSE_`, and `UNIX_` families, plus type constructors.
  * [String](/compatibility-modes/bigquery/functions/string): `SPLIT`, `CONTAINS_SUBSTR`, `INSTR`, `REGEXP_CONTAINS`, `REGEXP_EXTRACT`, `BYTE_LENGTH`, and more.
  * [JSON](/compatibility-modes/bigquery/functions/json): `JSON_VALUE`, `JSON_QUERY`, the `_ARRAY` variants, typed accessors, and the `->` operator.
  * [Array](/compatibility-modes/bigquery/functions/array): `GENERATE_ARRAY`, `GENERATE_DATE_ARRAY`, array literals, and lambdas.
  * [Aggregate and approximate](/compatibility-modes/bigquery/functions/aggregate): standard and statistical aggregates, `STRING_AGG`, `COUNTIF`, `LOGICAL_AND`, `LOGICAL_OR`, and the `HLL_COUNT` family.
  * [Math](/compatibility-modes/bigquery/functions/math): `DIV`, `SAFE_DIVIDE`, `PARSE_NUMERIC`, trigonometric helpers, and native math functions.
  * [Geography](/compatibility-modes/bigquery/functions/geography): `ST_GEOGPOINT`, `ST_GEOGFROMTEXT`, `ST_CONTAINS`, `ST_DISTANCE`, `ST_INTERSECTS`, and more.
  * [Conditional and conversion](/compatibility-modes/bigquery/functions/conditional-and-conversion): `IF`, `IFNULL`, `NULLIF`, `COALESCE`, `CASE`, the single-argument type functions, and `CAST`.
* [Statements](/compatibility-modes/bigquery/statements): `CREATE TABLE`, `CREATE VIEW`, `CREATE SCHEMA`, `DROP`, `ALTER TABLE`, `INSERT`, `UPDATE`, `DELETE`, and `TRUNCATE TABLE`.

## Enable the mode

Set the `dialect` session setting to `bigquery`:

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
SET dialect = 'bigquery';
```

Every statement in the session is then read as BigQuery GoogleSQL. You can also pass it as an HTTP query parameter (`?dialect=bigquery`) or in a `WITH (dialect='bigquery')` clause. Return to native Firebolt SQL with:

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
SET dialect = 'firebolt';
```

The default is `firebolt`. Only `bigquery` selects BigQuery mode.
