pub struct SQLContext { /* private fields */ }Expand description
Implementations§
Source§impl SQLContext
impl SQLContext
pub fn blob_reader_registry(&self) -> BlobReaderRegistry
Sourcepub async fn register_catalog(
&mut self,
catalog_name: impl Into<String>,
catalog: Arc<dyn Catalog>,
) -> DFResult<()>
pub async fn register_catalog( &mut self, catalog_name: impl Into<String>, catalog: Arc<dyn Catalog>, ) -> DFResult<()>
Registers a Paimon catalog under the given name.
The first registered catalog automatically becomes the current catalog for both Paimon-handled SQL and DataFusion-delegated SQL (SELECT, etc.). A “default” database is created if it does not already exist (matching the behavior of Spark/Flink Paimon catalogs).
Sourcepub async fn register_catalog_with_default_db(
&mut self,
catalog_name: impl Into<String>,
catalog: Arc<dyn Catalog>,
default_db: Option<&str>,
) -> DFResult<()>
pub async fn register_catalog_with_default_db( &mut self, catalog_name: impl Into<String>, catalog: Arc<dyn Catalog>, default_db: Option<&str>, ) -> DFResult<()>
Like Self::register_catalog but lets the caller control default-database init.
default_db = Some(name) ensures name exists and sets it as current on the
first catalog. default_db = None skips both — required for principals that
lack DESCRIBE / CREATEDATABASE on default. Mirrors Java FlinkCatalog’s
defaultDatabase / DISABLE_CREATE_TABLE_IN_DEFAULT_DB.
default_db = Some("") is rejected — pass None to opt out instead.
Note on built-in TVFs (vector_search, full_text_search): when
default_db = None, bare table names inside these functions still resolve
against the literal namespace "default" (the fallback in
[register_table_functions]). Callers using None must qualify table names
('db.table' or 'catalog.db.table') in those calls.
Sourcepub async fn set_current_catalog(
&mut self,
catalog_name: impl Into<String>,
) -> DFResult<()>
pub async fn set_current_catalog( &mut self, catalog_name: impl Into<String>, ) -> DFResult<()>
Sets the current catalog for unqualified table references.
Sourcepub async fn set_current_database(&self, database_name: &str) -> DFResult<()>
pub async fn set_current_database(&self, database_name: &str) -> DFResult<()>
Sets the current database for unqualified table references.
Sourcepub fn ctx(&self) -> &SessionContext
pub fn ctx(&self) -> &SessionContext
Returns a reference to the inner SessionContext.
Sourcepub fn register_temp_table(
&self,
name: impl Into<TableReference>,
table: Arc<dyn TableProvider>,
) -> DFResult<()>
pub fn register_temp_table( &self, name: impl Into<TableReference>, table: Arc<dyn TableProvider>, ) -> DFResult<()>
Registers a temporary in-memory table or view.
The name parameter accepts flexible table references, similar to DataFusion:
"my_table"— uses the current catalog and current database"database.my_table"— uses the current catalog with the specified database"catalog.database.my_table"— fully qualified
The table exists only for the lifetime of this SQLContext instance.
Sourcepub fn deregister_temp_table(
&self,
name: impl Into<TableReference>,
) -> DFResult<Option<Arc<dyn TableProvider>>>
pub fn deregister_temp_table( &self, name: impl Into<TableReference>, ) -> DFResult<Option<Arc<dyn TableProvider>>>
Deregisters a temporary table or view.
Accepts the same flexible name format as register_temp_table.
Sourcepub fn temp_table_exist(
&self,
name: impl Into<TableReference>,
) -> DFResult<bool>
pub fn temp_table_exist( &self, name: impl Into<TableReference>, ) -> DFResult<bool>
Returns whether a temporary table or view with the given name already exists.
Accepts the same flexible name format as register_temp_table.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SQLContext
impl !UnwindSafe for SQLContext
impl Freeze for SQLContext
impl Send for SQLContext
impl Sync for SQLContext
impl Unpin for SQLContext
impl UnsafeUnpin for SQLContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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 moreimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.