pub struct DataFusionCatalogBridge { /* private fields */ }Expand description
Bridges a Krishiv InMemoryCatalog into a DataFusion
CatalogProvider.
The bridge exposes a single schema named "public" that mirrors
the tables registered in the underlying InMemoryCatalog.
Implementations§
Source§impl DataFusionCatalogBridge
impl DataFusionCatalogBridge
Sourcepub fn new(catalog: Arc<RwLock<InMemoryCatalog>>) -> Self
pub fn new(catalog: Arc<RwLock<InMemoryCatalog>>) -> Self
Create a bridge from an InMemoryCatalog shared reference.
Sourcepub fn invalidate(&self, name: &str)
pub fn invalidate(&self, name: &str)
Invalidate the MemTable cache for name, forcing the next
table() call to rebuild the cached MemTable from the
catalog’s batch store. Call this after register_table_with_batches
mutates the underlying catalog so the bridge does not serve
a stale MemTable referencing the previous batch payload.
The DashMap cache is per-bridge and survives across DataFusion
table() calls; without this invalidation hook a second
register_table_with_batches for the same name would not be
visible to the DataFusion query plan.
Trait Implementations§
Source§impl CatalogProvider for DataFusionCatalogBridge
impl CatalogProvider for DataFusionCatalogBridge
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any
so that it can be downcast to a specific implementation.Source§fn schema_names(&self) -> Vec<String>
fn schema_names(&self) -> Vec<String>
Source§fn schema(&self, name: &str) -> Option<Arc<dyn SchemaProvider>>
fn schema(&self, name: &str) -> Option<Arc<dyn SchemaProvider>>
Source§fn register_schema(
&self,
name: &str,
schema: Arc<dyn SchemaProvider>,
) -> Result<Option<Arc<dyn SchemaProvider>>, DataFusionError>
fn register_schema( &self, name: &str, schema: Arc<dyn SchemaProvider>, ) -> Result<Option<Arc<dyn SchemaProvider>>, DataFusionError>
Source§fn deregister_schema(
&self,
_name: &str,
_cascade: bool,
) -> Result<Option<Arc<dyn SchemaProvider>>, DataFusionError>
fn deregister_schema( &self, _name: &str, _cascade: bool, ) -> Result<Option<Arc<dyn SchemaProvider>>, DataFusionError>
MemoryCatalogProvider, a non-empty schema
will only be successfully dropped when cascade is true.
This is equivalent to how DROP SCHEMA works in PostgreSQL. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DataFusionCatalogBridge
impl !UnwindSafe for DataFusionCatalogBridge
impl Freeze for DataFusionCatalogBridge
impl Send for DataFusionCatalogBridge
impl Sync for DataFusionCatalogBridge
impl Unpin for DataFusionCatalogBridge
impl UnsafeUnpin for DataFusionCatalogBridge
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§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>
T in a tonic::Request