> ## 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.

# Snowflake compatibility

> Run Snowflake SQL against Firebolt by switching the session dialect.

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

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

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

## What works

* [Query syntax](/reference-sql/snowflake/query-syntax): `SELECT`, `FROM`, joins including `NATURAL` and `USING`, `LATERAL`, set operations, `QUALIFY`, `GROUP BY ALL`, `GROUPING SETS`, `ROLLUP`, `CUBE`, CTEs, and `SELECT * EXCLUDE`.
* [Data types](/reference-sql/snowflake/data-types): `NUMBER`, `FLOAT`, `BOOLEAN`, `VARCHAR`, `BINARY`, `DATE`, `TIMESTAMP_NTZ`, `TIMESTAMP_LTZ`, `TIMESTAMP_TZ`, `ARRAY`, and `GEOGRAPHY`.
* [Operators](/reference-sql/snowflake/operators): arithmetic, comparison, and logical operators, the `::` cast, the `:` path operator, `ILIKE`, `RLIKE`, and `LIKE ANY`.
* Functions:
  * [Aggregate](/reference-sql/snowflake/functions/aggregate): `ANY_VALUE`, `APPROX_COUNT_DISTINCT`, `APPROX_PERCENTILE`, `ARRAY_AGG`, `AVG`, `CORR`, and more.
  * [Bitwise](/reference-sql/snowflake/functions/bitwise): `BITNOT`, `BITSHIFTLEFT`, `BITSHIFTRIGHT`, `BIT_NOT`, `GETBIT`.
  * [Conditional](/reference-sql/snowflake/functions/conditional): `COALESCE`, `GREATEST`, `IFF`, `IFNULL`, `LEAST`, `NOT`, and more.
  * [Context](/reference-sql/snowflake/functions/context): `CURRENT_DATABASE`, `CURRENT_SCHEMA`, `CURRENT_TRANSACTION`, `CURRENT_USER`.
  * [Conversion](/reference-sql/snowflake/functions/conversion): none available.
  * [Date and time](/reference-sql/snowflake/functions/date-and-time): none available.
  * [Geospatial](/reference-sql/snowflake/functions/geospatial): none available.
  * [Hash](/reference-sql/snowflake/functions/hash): `HASH`, `HASH_AGG`, with limitations.
  * [Numeric](/reference-sql/snowflake/functions/numeric): `ABS`, `ACOS`, `ASIN`, `ATAN2`, `ATAN`, `CBRT`, and more.
  * [Regular expressions](/reference-sql/snowflake/functions/regular-expressions): `REGEXP_EXTRACT_ALL`, `REGEXP_LIKE`.
  * [Semi-structured](/reference-sql/snowflake/functions/semi-structured): `ARRAYS_OVERLAP`, `ARRAY_CAT`, `ARRAY_DISTINCT`, `ARRAY_MAX`, `ARRAY_MIN`, `ARRAY_REVERSE`, and more.
  * [String and binary](/reference-sql/snowflake/functions/string): `ASCII`, `CONCAT`, `LEFT`, `LENGTH`, `LIKE`, `LOWER`, and more.
  * [Window](/reference-sql/snowflake/functions/window): `CUME_DIST`, `DENSE_RANK`, `FIRST_VALUE`, `LAG`, `LAST_VALUE`, `LEAD`, and more.
* [Statements](/reference-sql/snowflake/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 `snowflake`:

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

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

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

The default is `firebolt`. Only `snowflake` selects Snowflake mode.
