pub struct SparkSession(/* private fields */);Expand description
Root-owned SparkSession; delegates to the Polars backend.
Implementations§
Source§impl SparkSession
impl SparkSession
pub fn builder() -> SparkSessionBuilder
pub fn from_config(config: &SparklessConfig) -> SparkSession
pub fn read(&self) -> DataFrameReader
pub fn create_or_replace_temp_view(&self, name: &str, df: DataFrame)
pub fn create_global_temp_view(&self, name: &str, df: DataFrame)
pub fn create_or_replace_global_temp_view(&self, name: &str, df: DataFrame)
pub fn drop_temp_view(&self, name: &str)
pub fn drop_global_temp_view(&self, name: &str) -> bool
pub fn register_table(&self, name: &str, df: DataFrame)
pub fn register_database(&self, name: &str)
pub fn list_database_names(&self) -> Vec<String>
pub fn database_exists(&self, name: &str) -> bool
pub fn get_saved_table(&self, name: &str) -> Option<DataFrame>
pub fn saved_table_exists(&self, name: &str) -> bool
pub fn table_exists(&self, name: &str) -> bool
pub fn list_global_temp_view_names(&self) -> Vec<String>
pub fn list_temp_view_names(&self) -> Vec<String>
pub fn list_table_names(&self) -> Vec<String>
pub fn drop_table(&self, name: &str) -> bool
pub fn drop_database(&self, name: &str) -> bool
pub fn warehouse_dir(&self) -> Option<&str>
pub fn table(&self, name: &str) -> Result<DataFrame, PolarsError>
pub fn get_config(&self) -> &HashMap<String, String>
pub fn is_case_sensitive(&self) -> bool
pub fn register_udf<F>(&self, name: &str, f: F) -> Result<(), PolarsError>
pub fn create_dataframe( &self, data: Vec<(i64, i64, String)>, column_names: Vec<&str>, ) -> Result<DataFrame, PolarsError>
pub fn create_dataframe_engine( &self, data: Vec<(i64, i64, String)>, column_names: Vec<&str>, ) -> Result<DataFrame, EngineError>
pub fn create_dataframe_from_polars(&self, df: PlDataFrame) -> DataFrame
pub fn create_dataframe_from_rows( &self, rows: Vec<Vec<Value>>, schema: Vec<(String, String)>, ) -> Result<DataFrame, PolarsError>
pub fn create_dataframe_from_rows_engine( &self, rows: Vec<Vec<Value>>, schema: Vec<(String, String)>, ) -> Result<DataFrame, EngineError>
pub fn range( &self, start: i64, end: i64, step: i64, ) -> Result<DataFrame, PolarsError>
pub fn read_csv(&self, path: impl AsRef<Path>) -> Result<DataFrame, PolarsError>
pub fn read_csv_engine( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, EngineError>
pub fn read_parquet( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, PolarsError>
pub fn read_parquet_engine( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, EngineError>
pub fn read_json( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, PolarsError>
pub fn read_json_engine( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, EngineError>
pub fn sql(&self, query: &str) -> Result<DataFrame, PolarsError>
pub fn table_engine(&self, name: &str) -> Result<DataFrame, EngineError>
pub fn read_delta_from_path( &self, path: impl AsRef<Path>, ) -> Result<DataFrame, PolarsError>
pub fn stop(&self)
Trait Implementations§
Source§impl Clone for SparkSession
impl Clone for SparkSession
Source§fn clone(&self) -> SparkSession
fn clone(&self) -> SparkSession
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 SparkSession
impl RefUnwindSafe for SparkSession
impl Send for SparkSession
impl Sync for SparkSession
impl Unpin for SparkSession
impl UnsafeUnpin 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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more