Hello,
When using SQL Runner from the Develop Tab, if I run a query on a table as follows -
SELECT TOP 10 * FROM TABLE;
Then I click the gear Icon and attempt to move from SQL Runner to “Explore”
The connection to our Snowflake Database encounters an error while running the query.
More specifically, clicking Explore from the runner appears to construct a query where WITH sql_runner_query is used -
For whatever reason, while it appears that two of my fields are established with AS references that incorporate the sql_runner_query inside quotes, in the subsequent definition of the sql_runner_location value, the references to sql_runner_query.latitude and sql_runner_query.longitude instead place the quotes on the right of the word sql_runner_query.
i.e.
sql_runner_query.“latitude”
instead of
“sql_runner_query.latitude”
Snowflake fails with the error message -
SQL Syntax Error: SQL compilation error: error line 43 at position 14 invalid identifier ‘SQL_RUNNER_QUERY.“latitude”’
When I visit Snowflake directly and move the quote in front of the word sql_runner_query, all works as expected, and the query executes.
I have tried editing my model but no matter what I seem to edit within my model, I can’t seem to exclude “location” and I can’t seem to get the quotes to go in the right place.
Is this a bug or what am I doing wrong??
Excerpt from the query below -
WITH sql_runner_query AS (SELECT TOP 10 * FROM PUBLIC.TABLE)
SELECT
sql_runner_query."LATITUDE" AS "sql_runner_query.latitude",
sql_runner_query."LONGITUDE" AS "sql_runner_query.longitude",
CASE WHEN sql_runner_query."latitude" IS NOT NULL AND sql_runner_query."longitude" IS NOT NULL THEN (
COALESCE(CAST(sql_runner_query."latitude" AS VARCHAR),'') || ',' ||
COALESCE(CAST(sql_runner_query."longitude" AS VARCHAR),'')) ELSE NULL END
AS "sql_runner_query.location"
FROM sql_runner_query
GROUP BY
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41
ORDER BY
1
FETCH NEXT 5000 ROWS ONLY