Skip to content

Commit

Permalink
stop query on the processing engine when user clicks STOP on SQL Lab
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh Gulati committed Feb 17, 2022
1 parent f5f25ff commit 5805fb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/db_engine_specs/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ def handle_cursor( # pylint: disable=too-many-locals
job_id = None
query_id = query.id
while polled.operationState in unfinished_states:
# Queries don't terminate when user clicks the STOP button on SQL LAB.
# Refresh session so that the `query.status` modified in stop_query in
# views/core.py is reflected here.
session.refresh(query)
query = session.query(type(query)).filter_by(id=query_id).one()
if query.status == QueryStatus.STOPPED:
cursor.cancel()
Expand Down

0 comments on commit 5805fb3

Please sign in to comment.