superset
superset copied to clipboard
Snowflake connector does not automatically surround field names in double-quotes
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
- Launch Superset via a Docker container.
- Add a Snowflake data source.
- Create a new chart using the data source.
- Drag fields onto the chart designer and create chart.
- 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:
Workaround:
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.
@rusackas you are the sole person listed in the database rolodex for Snowflake - do you have any thoughts on this?
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?
We are using Snowflake too and having the same issue. Pretty frustrating no one is picking up this issue and fix it :/
@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.
Possibly relevant: https://stackoverflow.com/a/68311509
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.