pub struct SparkSessionBuilder { /* private fields */ }Expand description
Builder for creating SparkSession instances.
Configures a connection to a Spark Connect endpoint following the URL format defined by Apache Spark’s client connection spec.
§Example
use spark_connect::SparkSessionBuilder;
let session = SparkSessionBuilder::new("sc://localhost:15002")
.build()
.await
.unwrap();
println!("Session ID: {}", session.session_id());Implementations§
Source§impl SparkSessionBuilder
impl SparkSessionBuilder
Sourcepub fn new(connection: &str) -> Self
pub fn new(connection: &str) -> Self
Creates a new builder from a Spark Connect connection string.
The connection string must follow the format:
sc://<host>:<port>/;key1=value1;key2=value2;...
Sourcepub async fn build(&self) -> Result<SparkSession, SparkError>
pub async fn build(&self) -> Result<SparkSession, SparkError>
Establishes a connection and returns a ready-to-use SparkSession.
This method performs:
- gRPC channel setup;
- Metadata interceptor attachment;
SparkClientinitialization.
Trait Implementations§
Source§impl Clone for SparkSessionBuilder
impl Clone for SparkSessionBuilder
Source§fn clone(&self) -> SparkSessionBuilder
fn clone(&self) -> SparkSessionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SparkSessionBuilder
impl RefUnwindSafe for SparkSessionBuilder
impl Send for SparkSessionBuilder
impl Sync for SparkSessionBuilder
impl Unpin for SparkSessionBuilder
impl UnwindSafe for SparkSessionBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request