Struct spark_connect_core::session::SparkSession
source · pub struct SparkSession { /* private fields */ }
Expand description
The entry point to connecting to a Spark Cluster using the Spark Connection gRPC protocol.
Implementations§
source§impl SparkSession
impl SparkSession
pub fn new( client: SparkConnectClient<InterceptedService<Channel, MetadataInterceptor>> ) -> Self
sourcepub fn range(
self,
start: Option<i64>,
end: i64,
step: i64,
num_partitions: Option<i32>
) -> DataFrame
pub fn range( self, start: Option<i64>, end: i64, step: i64, num_partitions: Option<i32> ) -> DataFrame
Create a DataFrame with a spingle column named id
,
containing elements in a range from start
(default 0) to
end
(exclusive) with a step value step
, and control the number
of partitions with num_partitions
sourcepub fn read(self) -> DataFrameReader
pub fn read(self) -> DataFrameReader
Returns a DataFrameReader that can be used to read datra in as a DataFrame
sourcepub fn readStream(self) -> DataStreamReader
pub fn readStream(self) -> DataStreamReader
Returns a DataFrameReader that can be used to read datra in as a DataFrame
pub fn table(self, name: &str) -> Result<DataFrame, SparkError>
sourcepub fn catalog(self) -> Catalog
pub fn catalog(self) -> Catalog
Interface through which the user may create, drop, alter or query underlying databases, tables, functions, etc.
sourcepub async fn sql(self, sql_query: &str) -> Result<DataFrame, SparkError>
pub async fn sql(self, sql_query: &str) -> Result<DataFrame, SparkError>
Returns a DataFrame representing the result of the given query
pub fn createDataFrame( self, data: &RecordBatch ) -> Result<DataFrame, SparkError>
sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Return the session ID
sourcepub fn client(
self
) -> SparkConnectClient<InterceptedService<Channel, MetadataInterceptor>>
pub fn client( self ) -> SparkConnectClient<InterceptedService<Channel, MetadataInterceptor>>
Spark Connection gRPC client interface
Trait Implementations§
source§impl Clone for SparkSession
impl Clone for SparkSession
source§fn clone(&self) -> SparkSession
fn clone(&self) -> SparkSession
Returns a copy 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 SparkSession
impl !RefUnwindSafe for SparkSession
impl Send for SparkSession
impl Sync for SparkSession
impl Unpin for SparkSession
impl !UnwindSafe for SparkSession
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> 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