mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(sqlparse): improve table parsing (#26476)
This commit is contained in:
@@ -50,7 +50,7 @@ class PrestoDBSQLValidator(BaseSQLValidator):
|
||||
) -> Optional[SQLValidationAnnotation]:
|
||||
# pylint: disable=too-many-locals
|
||||
db_engine_spec = database.db_engine_spec
|
||||
parsed_query = ParsedQuery(statement)
|
||||
parsed_query = ParsedQuery(statement, engine=db_engine_spec.engine)
|
||||
sql = parsed_query.stripped()
|
||||
|
||||
# Hook to allow environment-specific mutation (usually comments) to the SQL
|
||||
@@ -154,7 +154,7 @@ class PrestoDBSQLValidator(BaseSQLValidator):
|
||||
For example, "SELECT 1 FROM default.mytable" becomes "EXPLAIN (TYPE
|
||||
VALIDATE) SELECT 1 FROM default.mytable.
|
||||
"""
|
||||
parsed_query = ParsedQuery(sql)
|
||||
parsed_query = ParsedQuery(sql, engine=database.db_engine_spec.engine)
|
||||
statements = parsed_query.get_statements()
|
||||
|
||||
logger.info("Validating %i statement(s)", len(statements))
|
||||
|
||||
Reference in New Issue
Block a user