superset icon indicating copy to clipboard operation
superset copied to clipboard

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

Open gs-scooter opened this issue 1 year ago • 6 comments

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:

image

Workaround:

image

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.

gs-scooter avatar Oct 26 '23 20:10 gs-scooter

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

sfirke avatar Oct 31 '23 16:10 sfirke

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?

rusackas avatar Feb 01 '24 21:02 rusackas

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

wavenator avatar May 08 '24 20:05 wavenator

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

rusackas avatar May 09 '24 01:05 rusackas

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

sfirke avatar May 09 '24 01:05 sfirke

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.

mistercrunch avatar May 10 '24 04:05 mistercrunch