mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
feat: Add "is_select_query" method to base engine spec to make it possible to override it (#15013)
This commit is contained in:
parent
cf15fe0d03
commit
11eef251b2
@ -1254,6 +1254,14 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
or parsed_query.is_show()
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def is_select_query(cls, parsed_query: ParsedQuery) -> bool:
|
||||
"""
|
||||
Determine if the statement should be considered as SELECT statement.
|
||||
Some query dialects do not contain "SELECT" word in queries (eg. Kusto)
|
||||
"""
|
||||
return parsed_query.is_select()
|
||||
|
||||
@classmethod
|
||||
@utils.memoized
|
||||
def get_column_spec(
|
||||
|
@ -217,7 +217,7 @@ def execute_sql_statement(
|
||||
query.select_as_cta_used = True
|
||||
|
||||
# Do not apply limit to the CTA queries when SQLLAB_CTAS_NO_LIMIT is set to true
|
||||
if parsed_query.is_select() and not (
|
||||
if db_engine_spec.is_select_query(parsed_query) and not (
|
||||
query.select_as_cta_used and SQLLAB_CTAS_NO_LIMIT
|
||||
):
|
||||
if SQL_MAX_ROW and (not query.limit or query.limit > SQL_MAX_ROW):
|
||||
|
Loading…
Reference in New Issue
Block a user