- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 11:31 AM
I am trying to query a snowflake table from a databricks data frame similar to the following example.
sql_query = "select * from Database.Schema.Table_/Name_/V"
sqlContext.sql(f"{sql_query}" )
And I get an error like this.
ParseException:
[PARSE_SYNTAX_ERROR] Syntax error at or near '/'(line 1, pos 36)
== SQL ==
select * from Database.Schema.Table_/Name_/V
------------------------------------^^^
Does anyone know how I can escape those / characters?
- Labels:
-
Dataframe
-
Error
-
Query
-
Query Table
-
Sql query
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:16 AM
Your answer was close but still had the error. This is what we found to work in our snowflake query from a data bricks data frame:
.option("query", "select * from Database.schema.\"Table_/Name_/V\"") \
This was because the query was already inside quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 09:20 PM
You can use Double Quotes to get the plan. Using quotes it is important to write the table names in capital letters.
SELECT * FROM "/TABLE/NAME"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:16 AM
Your answer was close but still had the error. This is what we found to work in our snowflake query from a data bricks data frame:
.option("query", "select * from Database.schema.\"Table_/Name_/V\"") \
This was because the query was already inside quotes.

