-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement on_kill() for SQLExecuteQueryOperator #27514
Conversation
23073ef
to
622c37c
Compare
For the other databases we could use something like:
if we will save the latest queries as well as QueryId |
622c37c
to
9c0ad7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I like the way it is implemented now.
1bbeb06
to
186036b
Compare
@@ -264,6 +266,7 @@ def run( | |||
results = [] | |||
for sql_statement in sql: | |||
self._run_command(cur, sql_statement, parameters) | |||
self._update_query_ids(cur) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, the query is done, so what is the utility of updating the query id list here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have access to any Trino and Presto instances to check it also for these DBs?
186036b
to
928a2cc
Compare
@kazanzhy do we have something else to resolve or this PR is ready for final review? |
@eladkal why do you think we should merge this, given that it does not do what it tries to do? The queries it says are running are not actually running. The queries it will kill in on_kill are not running. Before we add a new interface, shouldn't we start with code that does what it's supposed to do? |
@@ -264,6 +266,7 @@ def run( | |||
results = [] | |||
for sql_statement in sql: | |||
self._run_command(cur, sql_statement, parameters) | |||
self._update_query_ids(cur) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that we need to address this issue, where the queries aren't actually running and therefore will not be killed, before adding this interface.
I didnt say we should merge this. I asked if its ready to review. I wasnt sure if the running queries problem was adressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually need changes in the hook to capture query IDs and kill them, couldn't that be solely on the operators?
From an architectural PoV it feels odd/out-of-place with the rest of the code base they were track what is effectively operator state (query ids) on the hook object rather than in the Operator object
OK cool i thought it meant like... you were preparing to merge it :) Cus I had commented after the recent updates like saying "this is still an issue" but then no response and the next thing i saw was "ok anything else"? Maybe it was the word "final" which I interpreted to mean you thought it was basically done. But yeah definitely more work to do. Anyway, thank you. Looking forward to getting this right... just ... want to get it right :) |
@dstandish I understand your concerns about this PR. I'm proposing the following steps when we will be sure that Trino
|
928a2cc
to
20538cf
Compare
I'm a little skeptical about |
20538cf
to
68602b9
Compare
68602b9
to
ec760ac
Compare
This PR is really overloaded. |
great, thanks |
Can I conclude that this PR should be closed as well #27314 because of the absent possibility of canceling queries after their execution using a synchronous cursor? |
Discussion: https://apache-airflow.slack.com/archives/CCPRP7943/p1666718396900909
closes: #27314