mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
stop query on the processing engine when user clicks STOP on SQL Lab (#18789)
Co-authored-by: Saurabh Gulati <saurabh.gulati@fedex.com>
This commit is contained in:
parent
535634310b
commit
d632590eff
@ -335,6 +335,10 @@ class HiveEngineSpec(PrestoEngineSpec):
|
|||||||
job_id = None
|
job_id = None
|
||||||
query_id = query.id
|
query_id = query.id
|
||||||
while polled.operationState in unfinished_states:
|
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()
|
query = session.query(type(query)).filter_by(id=query_id).one()
|
||||||
if query.status == QueryStatus.STOPPED:
|
if query.status == QueryStatus.STOPPED:
|
||||||
cursor.cancel()
|
cursor.cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user