Skip to content

[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

Closed
wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented May 3, 2025

What changes were proposed in this pull request?

This PR aims to support interrupt(Tag|Operation|All) API of SparkSession.

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.

@@ -136,4 +136,25 @@ struct SparkSessionTests {
}
await spark.stop()
}

@Test
func interruptAll() async throws {
Copy link
Member Author

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] {
Copy link
Member

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?

Copy link
Member Author

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]

Copy link
Member Author

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;
}

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya .

@dongjoon-hyun
Copy link
Member Author

Merged to main.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-51992 branch May 3, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants