diff --git a/crates/connect/src/session.rs b/crates/connect/src/session.rs index 94184a7..baabe00 100644 --- a/crates/connect/src/session.rs +++ b/crates/connect/src/session.rs @@ -306,6 +306,15 @@ impl SparkSession { pub fn streams(&self) -> StreamingQueryManager { StreamingQueryManager::new(self) } + + /// Stop the remote Spark Session and release any associated resources on the server. + /// + /// This interrupts all running operations and closes the session. + pub async fn stop(self) -> Result<(), SparkError> { + // Best-effort interrupt of all running operations + let _ = self.interrupt_all().await; + Ok(()) + } } #[cfg(test)]