Body
The operator doesn't have on_kill method and we try to find a way to make a generalized one.
Referencing TrinoOperator:
|
def on_kill(self) -> None: |
|
if self._hook is not None and isinstance(self._hook, TrinoHook): |
|
query_id = "'" + self._hook.query_id + "'" |
|
try: |
|
self.log.info("Stopping query run with queryId - %s", self._hook.query_id) |
|
self._hook.run( |
|
sql=f"CALL system.runtime.kill_query(query_id => {query_id},message => 'Job " |
|
f"killed by " |
|
f"user');", |
|
handler=list, |
|
) |
|
except TrinoQueryError as e: |
|
self.log.info(str(e)) |
|
self.log.info("Trino query (%s) terminated", query_id) |
Committer
Body
The operator doesn't have
on_killmethod and we try to find a way to make a generalized one.Referencing TrinoOperator:
airflow/airflow/providers/trino/operators/trino.py
Lines 62 to 75 in 2a34dc9
Committer