-
Notifications
You must be signed in to change notification settings - Fork 5
[SPARK-51992] Support interrupt(Tag|Operation|All)
in SparkSession
#108
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
Conversation
@@ -136,4 +136,25 @@ struct SparkSessionTests { | |||
} | |||
await spark.stop() | |||
} | |||
|
|||
@Test | |||
func interruptAll() async throws { |
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.
For now, these tests are doing API invocation tests only.
/// Request to interrupt an operation of this session, given its operation ID. | ||
/// - Returns: Sequence of operation IDs requested to be interrupted. | ||
@discardableResult | ||
public func interruptOperation(_ operationId: String) async throws -> [String] { |
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 this only returns one operation id. Does it need to be a sequence?
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.
Yes, these Apache Spark 4.0.0 APIs return Seq[String]
from Spark side definition.
def interruptAll(): Seq[String]
def interruptTag(tag: String): Seq[String]
def interruptOperation(operationId: String): Seq[String]
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.
It shares the same protobuf reponse where interrupted_ids
is repeated string type.
message InterruptResponse {
// Session id in which the interrupt was running.
string session_id = 1;
// Server-side generated idempotency key that the client can use to assert that the server side
// session has not changed.
string server_side_session_id = 3;
// Operation ids of the executions which were interrupted.
repeated string interrupted_ids = 2;
}
Thank you, @viirya . |
Merged to main. |
What changes were proposed in this pull request?
This PR aims to support
interrupt(Tag|Operation|All)
API ofSparkSession
.Why are the changes needed?
For feature parity.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the CIs.
Was this patch authored or co-authored using generative AI tooling?
No.