Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/pages/product/configuration/data-sources/snowflake.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ redirect_from:
- [The region][snowflake-docs-regions] for the [Snowflake][snowflake] warehouse
- The username/password for the [Snowflake][snowflake] account

## Snowflake quoted identifiers

Due to an issue in snowflakes opinion about quoted identifers we set a session value to override
snowflake defaults for users that have set an account value for: QUOTED_IDENTIFIERS_IGNORE_CASE
you can learn more about this here: https://docs.snowflake.com/en/sql-reference/identifiers-syntax#double-quoted-identifiers

## Setup

<WarningBox>
Expand Down
9 changes: 8 additions & 1 deletion packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,14 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {

await this.execute(connection, 'ALTER SESSION SET TIMEZONE = \'UTC\'', [], false);
await this.execute(connection, `ALTER SESSION SET STATEMENT_TIMEOUT_IN_SECONDS = ${this.config.executionTimeout}`, [], false);

/**
* Because snowflake has an opinion about the shape of data returns over the api.
* we have to set this value to false in order for our schema requests to succeed.
*
* You can learn more here.
* https://docs.snowflake.com/en/sql-reference/identifiers-syntax#double-quoted-identifiers
*/
await this.execute(connection, 'ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE', [], false);
return connection;
} catch (e) {
this.connection = null;
Expand Down
Loading