When using Snowflake as a data source for a chart, the chart will fail with a SQL compilation error. The only workaround is to go into the field's custom SQL and surround it with double-quotes. This bug exists in the preset.io product as well.

How to reproduce the bug

  1. Launch Superset via a Docker container.
  2. Add a Snowflake data source.
  3. Create a new chart using the data source.
  4. Drag fields onto the chart designer and create chart.
  5. See compilation error referencing invalid identifier 'FIELD_NAME'.

Expected results

No SQL compilation error. The Snowflake connector should work out of the box.

Screenshots

Error:

Apache Superset Snowflake connector does not automatically surround field names in double-quotes

Workaround:

Apache Superset Snowflake connector does not automatically surround field names in double-quotes

Environment

  • browser type and version: Vivaldi 6.2.3105.58
  • superset version: Version on latest Docker image.
  • any feature flags active: snowflake-sqlalchemy driver installed.

Comment From: sfirke

@rusackas you are the sole person listed in the database rolodex for Snowflake - do you have any thoughts on this?

Comment From: rusackas

I have access to a database to reproduce issues, but I don't use it on any real basis, or know much about actually fixing it. I think @villebro might use it too?

Comment From: wavenator

We are using Snowflake too and having the same issue. Pretty frustrating no one is picking up this issue and fix it :/

Comment From: rusackas

@wavenator please feel free, you have as much right as anyone to fix it, and if you're affected by it, you have all the more reason to. I understand the frustration, but there are an awful lot of issues, and never enough contributors.

Comment From: sfirke

Possibly relevant: https://stackoverflow.com/a/68311509

Comment From: mistercrunch

Yes it does seem related to case sensitivity. It'd help to get more information on the schema's case and the SQL generated. Also relevant -> https://community.snowflake.com/s/article/How-to-ignore-the-case-of-quoted-identifiers-on-Snowflake#:~:text=Quoted%20identifiers%20are%20identifiers%20such,you%20will%20get%20an%20error.

Comment From: rusackas

Tempted to close this as stale, but is anyone still facing this in 4.1.1 or 5.0.0rc1?

Comment From: wavenator

Yep still experiencing this issue