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
…18789)

Co-authored-by: Saurabh Gulati <saurabh.gulati@fedex.com>
  • Loading branch information
saurabh3091 and Saurabh Gulati authored Feb 22, 2022
1 parent 5356343 commit d632590
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 d632590

Please sign in to comment.