Hi everyone, I’m encountering a SQL compilation error when trying to validate a Snowflake table that has special characters in its name.
Environment:
- GX Version: 0.15.50
Datasource: Snowflake
Table Name:MY_TABLE_{[(&%$#@!^:;})]
The Issue: When I attempt to get a batch for this table, Snowflake throws a ProgrammingError because it doesn’t recognize the special characters as part of the table name. It looks like the table name isn’t being quoted properly before being sent to the SQLAlchemy engine.
(snowflake.connector.errors.ProgrammingError) 001003 (42000): SQL compilation error:
syntax error line 2 at position 18 unexpected ‘(’.
syntax error line 2 at position 35 unexpected ‘.’.
[SQL: SELECT * FROM MY_TABLE_{[(&%$#@!^:;})] LIMIT %(param_1)s]
What I’ve tried: I noticed that if I use a raw query with manual double quotes (e.g., SELECT * FROM "MY_TABLE_{[(&%$#@!^:;})]"), it works.
asset = ds.add_query_asset( name=“query_asset”, query=raw_query )
However, passing the table name to the standard Batch Request fails.
How can I properly escape this table name in version 0.15.50 so that Great Expectations wraps it in double quotes for the SQL execution?