Error previewing data when schema is backquoted and dialect not supported in sqlglot #32141
Unanswered
wjsi
asked this question in
Q&A / Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are developing a plugin to enable superset users to use MaxCompute of Alibaba Cloud, and a parsing issue blocks users from obtaining preview data from tables.
MaxCompute uses a three-layered table location semantic, i.e.,
<project>/<schema>/<table>
to locate a table, and the default name of the schema isdefault
. When previewing the data in SQL Lab in superset, it generates a SQL statement (at client side?) like this:and the name
default
is backquoted (maybe to avoid conflicts with keywords in SQL?). When this statement is submitted into superset, it raises an error:The cause is that connections in superset disallows DMLs by default. When trying to judge if the statement is a DML, superset calls sqlglot to parse the statement, and sqlglot failed to parse the statement with backquotes in its default dialect (as sqlglot does not support MaxCompute SQL by now):
As
BaseEngineSpec
has anis_select_query
method, is it possible to call this method as a fallback? That is, turnsuperset/superset/sql_lab.py
Lines 244 to 250 in c7c3b1b
into something like
and then we do not need to implement a complete dialect for sqlglot by now.
Beta Was this translation helpful? Give feedback.
All reactions