Skip to main content

DatumSqlContext

Struct DatumSqlContext 

Source
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

Source

pub fn new() -> Self

Creates a SQL context with one DataFusion target partition and Datum’s planner placeholder functions registered.

Source

pub fn with_streaming_join_config(self, config: StreamingJoinConfig) -> Self

Returns this context with a different streaming join policy.

Source

pub fn set_streaming_join_config(&mut self, config: StreamingJoinConfig)

Replaces the streaming join policy used by future query lowering.

Source

pub const fn streaming_join_config(&self) -> &StreamingJoinConfig

Returns the configured streaming join policy.

Source

pub fn register_source( &self, name: &str, schema: SchemaRef, source: Source<RecordBatch>, ) -> Result<()>

Registers an append-only Datum source as a SQL table.

Source

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.

Source

pub fn register_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
where F: Fn() -> Source<RecordBatch> + Send + Sync + 'static,

Registers a factory for append-only Datum sources as a SQL table.

Source

pub fn register_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
where F: Fn() -> Source<RecordBatch> + Send + Sync + 'static,

Registers a factory for append-only Datum sources with event time.

Source

pub fn register_committable_source( &self, name: &str, schema: SchemaRef, source: Source<CommittableRecordBatch>, ) -> Result<()>

Registers a committable append-only source as a SQL table.

Source

pub fn register_committable_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
where F: Fn() -> Source<CommittableRecordBatch> + Send + Sync + 'static,

Registers a factory for committable append-only sources as a SQL table.

Source

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.

Source

pub fn register_committable_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
where F: Fn() -> Source<CommittableRecordBatch> + Send + Sync + 'static,

Registers a factory for committable append-only sources with event time.

Source

pub fn register_changelog_source( &self, name: &str, schema: SchemaRef, source: Source<ChangelogBatch>, ) -> Result<()>

Registers an updating source as a SQL table.

Source

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.

Source

pub fn register_changelog_source_factory<F>( &self, name: &str, schema: SchemaRef, source_factory: F, ) -> Result<()>
where F: Fn() -> Source<ChangelogBatch> + Send + Sync + 'static,

Registers a factory for updating sources as a SQL table.

Source

pub fn register_changelog_source_factory_with_event_time<F>( &self, name: &str, schema: SchemaRef, source_factory: F, event_time: EventTimeConfig, ) -> Result<()>
where F: Fn() -> Source<ChangelogBatch> + Send + Sync + 'static,

Registers a factory for updating sources with event time.

Source

pub async fn physical_plan(&self, sql: &str) -> Result<Arc<dyn ExecutionPlan>>

Returns DataFusion’s physical plan for SQL text without lowering it.

Source

pub async fn execute(&self, sql: &str) -> Result<Vec<RecordBatch>>

Executes a bounded append-only query and collects the output batches.

Source

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.

Source

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.

Source

pub async fn execute_streaming( &self, sql: &str, ) -> Result<ContinuousQueryHandle>

Materializes a continuous SQL query, or an INSERT INTO sink query.

Source

pub async fn execute_insert_into( &self, sql: &str, ) -> Result<ContinuousQueryHandle>

Parses and materializes INSERT INTO <sink> SELECT ....

Source

pub async fn select_into( &self, select_sql: &str, sink_name: &str, ) -> Result<ContinuousQueryHandle>

Materializes a SELECT body into a registered sink.

Source

pub fn register_append_sink<F>(&self, name: &str, writer: F) -> Result<()>
where F: Fn(RecordBatch) -> StreamResult<()> + Send + Sync + 'static,

Registers an append-only sink callback.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DatumSqlContext

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Message for T
where T: Any + Send + 'static,

Source§

fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>

Convert a BoxedMessage to this concrete type
Source§

fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>

Convert this message to a BoxedMessage
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> State for T
where T: Any + Send + 'static,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more