pub struct DatumSqlContext { /* private fields */ }Expand description
SQL planning context that registers Datum sources and executes supported DataFusion physical plans on Datum.
Implementations§
Source§impl DatumSqlContext
impl DatumSqlContext
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a SQL context with one DataFusion target partition and Datum’s planner placeholder functions registered.
Sourcepub fn with_streaming_join_config(self, config: StreamingJoinConfig) -> Self
pub fn with_streaming_join_config(self, config: StreamingJoinConfig) -> Self
Returns this context with a different streaming join policy.
Sourcepub fn set_streaming_join_config(&mut self, config: StreamingJoinConfig)
pub fn set_streaming_join_config(&mut self, config: StreamingJoinConfig)
Replaces the streaming join policy used by future query lowering.
Sourcepub const fn streaming_join_config(&self) -> &StreamingJoinConfig
pub const fn streaming_join_config(&self) -> &StreamingJoinConfig
Returns the configured streaming join policy.
Sourcepub fn register_source(
&self,
name: &str,
schema: SchemaRef,
source: Source<RecordBatch>,
) -> Result<()>
pub fn register_source( &self, name: &str, schema: SchemaRef, source: Source<RecordBatch>, ) -> Result<()>
Registers an append-only Datum source as a SQL table.
Sourcepub fn register_source_with_event_time(
&self,
name: &str,
schema: SchemaRef,
source: Source<RecordBatch>,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_source_with_event_time( &self, name: &str, schema: SchemaRef, source: Source<RecordBatch>, event_time: EventTimeConfig, ) -> Result<()>
Registers an append-only Datum source and event-time declaration as a SQL table.
Sourcepub fn register_source_factory<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
) -> Result<()>
pub fn register_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
Registers a factory for append-only Datum sources as a SQL table.
Sourcepub fn register_source_factory_with_event_time<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
Registers a factory for append-only Datum sources with event time.
Sourcepub fn register_committable_source(
&self,
name: &str,
schema: SchemaRef,
source: Source<CommittableRecordBatch>,
) -> Result<()>
pub fn register_committable_source( &self, name: &str, schema: SchemaRef, source: Source<CommittableRecordBatch>, ) -> Result<()>
Registers a committable append-only source as a SQL table.
Sourcepub fn register_committable_source_factory<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
) -> Result<()>
pub fn register_committable_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
Registers a factory for committable append-only sources as a SQL table.
Sourcepub fn register_committable_source_with_event_time(
&self,
name: &str,
schema: SchemaRef,
source: Source<CommittableRecordBatch>,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_committable_source_with_event_time( &self, name: &str, schema: SchemaRef, source: Source<CommittableRecordBatch>, event_time: EventTimeConfig, ) -> Result<()>
Registers a committable append-only source and event-time declaration as a SQL table.
Sourcepub fn register_committable_source_factory_with_event_time<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_committable_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
Registers a factory for committable append-only sources with event time.
Sourcepub fn register_changelog_source(
&self,
name: &str,
schema: SchemaRef,
source: Source<ChangelogBatch>,
) -> Result<()>
pub fn register_changelog_source( &self, name: &str, schema: SchemaRef, source: Source<ChangelogBatch>, ) -> Result<()>
Registers an updating source as a SQL table.
Sourcepub fn register_changelog_source_with_event_time(
&self,
name: &str,
schema: SchemaRef,
source: Source<ChangelogBatch>,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_changelog_source_with_event_time( &self, name: &str, schema: SchemaRef, source: Source<ChangelogBatch>, event_time: EventTimeConfig, ) -> Result<()>
Registers an updating source and event-time declaration as a SQL table.
Sourcepub fn register_changelog_source_factory<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
) -> Result<()>
pub fn register_changelog_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
Registers a factory for updating sources as a SQL table.
Sourcepub fn register_changelog_source_factory_with_event_time<F>(
&self,
name: &str,
schema: SchemaRef,
source_factory: F,
event_time: EventTimeConfig,
) -> Result<()>
pub fn register_changelog_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
Registers a factory for updating sources with event time.
Sourcepub async fn physical_plan(&self, sql: &str) -> Result<Arc<dyn ExecutionPlan>>
pub async fn physical_plan(&self, sql: &str) -> Result<Arc<dyn ExecutionPlan>>
Returns DataFusion’s physical plan for SQL text without lowering it.
Sourcepub async fn execute(&self, sql: &str) -> Result<Vec<RecordBatch>>
pub async fn execute(&self, sql: &str) -> Result<Vec<RecordBatch>>
Executes a bounded append-only query and collects the output batches.
Sourcepub async fn streaming_source(
&self,
sql: &str,
) -> Result<Source<SqlEvent<RecordBatch>>>
pub async fn streaming_source( &self, sql: &str, ) -> Result<Source<SqlEvent<RecordBatch>>>
Lowers a continuous SQL query into a Datum source of data/control events.
Sourcepub async fn streaming_source_with_metrics(
&self,
sql: &str,
) -> Result<(Source<SqlEvent<RecordBatch>>, SqlExecutionMetrics)>
pub async fn streaming_source_with_metrics( &self, sql: &str, ) -> Result<(Source<SqlEvent<RecordBatch>>, SqlExecutionMetrics)>
Lowers a continuous SQL query and returns shared execution metrics.
Sourcepub async fn execute_streaming(
&self,
sql: &str,
) -> Result<ContinuousQueryHandle>
pub async fn execute_streaming( &self, sql: &str, ) -> Result<ContinuousQueryHandle>
Materializes a continuous SQL query, or an INSERT INTO sink query.
Sourcepub async fn execute_insert_into(
&self,
sql: &str,
) -> Result<ContinuousQueryHandle>
pub async fn execute_insert_into( &self, sql: &str, ) -> Result<ContinuousQueryHandle>
Parses and materializes INSERT INTO <sink> SELECT ....
Sourcepub async fn select_into(
&self,
select_sql: &str,
sink_name: &str,
) -> Result<ContinuousQueryHandle>
pub async fn select_into( &self, select_sql: &str, sink_name: &str, ) -> Result<ContinuousQueryHandle>
Materializes a SELECT body into a registered sink.
Sourcepub fn register_append_sink<F>(&self, name: &str, writer: F) -> Result<()>
pub fn register_append_sink<F>(&self, name: &str, writer: F) -> Result<()>
Registers an append-only sink callback.
Sourcepub fn register_changelog_sink<F, G>(
&self,
name: &str,
append_writer: F,
changelog_writer: G,
) -> Result<()>where
F: Fn(RecordBatch) -> StreamResult<()> + Send + Sync + 'static,
G: Fn(ChangelogBatch) -> StreamResult<()> + Send + Sync + 'static,
pub fn register_changelog_sink<F, G>(
&self,
name: &str,
append_writer: F,
changelog_writer: G,
) -> Result<()>where
F: Fn(RecordBatch) -> StreamResult<()> + Send + Sync + 'static,
G: Fn(ChangelogBatch) -> StreamResult<()> + Send + Sync + 'static,
Registers a sink callback that can consume both append-only and updating streams.
Trait Implementations§
Source§impl Debug for DatumSqlContext
impl Debug for DatumSqlContext
Auto Trait Implementations§
impl !RefUnwindSafe for DatumSqlContext
impl !UnwindSafe for DatumSqlContext
impl Freeze for DatumSqlContext
impl Send for DatumSqlContext
impl Sync for DatumSqlContext
impl Unpin for DatumSqlContext
impl UnsafeUnpin for DatumSqlContext
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 more