wanghong1314 commented on code in PR #22441:
URL: https://github.com/apache/superset/pull/22441#discussion_r1051297231
##########
superset/db_engine_specs/impala.py:
##########
@@ -63,3 +74,117 @@ def get_schema_names(cls, inspector: Inspector) ->
List[str]:
if not row[0].startswith("_")
]
return schemas
+
+ @classmethod
+ def has_implicit_cancel(cls) -> bool:
+ """
+ Return True if the live cursor handles the implicit cancelation of the
query,
+ False otherise.
+
+ :return: Whether the live cursor implicitly cancels the query
+ :see: handle_cursor
+ """
+
+ return True
+
+ @classmethod
+ def execute( # pylint: disable=unused-argument
+ cls,
+ cursor: Any,
+ query: str,
+ **kwargs: Any,
+ ) -> None: # pylint: disable=arguments-differ
+ # kwargs = {"async": async_}
+ try:
+ cursor.execute_async(query)
+ except Exception as ex:
+ raise cls.get_dbapi_mapped_exception(ex)
+
+ @classmethod
+ def handle_cursor(cls, cursor: Any, query: Query, session: Session) ->
None:
+ """Stop query and updates progress information"""
+
+ query_id = query.id
+ unfinished_states = (
+ "INITIALIZED_STATE",
+ "RUNNING_STATE",
+ )
+ # When the query status is pending, the stop operation is queried
+ # Refresh session so that the `query.status` and
`query.extra.get(is_stopped)`
+ # modified in stop_query in views / core.py is reflected here.
+ # stop query
+ if cls.is_cancel_query(cls, query, session, query_id):
Review Comment:
the impala query cancellation needs to be obtained in the cursor, similar to
the hive engine query cancellation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]