Struct MemorySourceConfig

Source
pub struct MemorySourceConfig { /* private fields */ }
Expand description

Data source configuration for reading in-memory batches of data

Implementations§

Source§

impl MemorySourceConfig

Source

pub fn try_new( partitions: &[Vec<RecordBatch>], schema: SchemaRef, projection: Option<Vec<usize>>, ) -> Result<Self>

Create a new MemorySourceConfig for reading in-memory record batches The provided schema should not have the projection applied.

Source

pub fn try_new_exec( partitions: &[Vec<RecordBatch>], schema: SchemaRef, projection: Option<Vec<usize>>, ) -> Result<Arc<DataSourceExec>>

Create a new DataSourceExec plan for reading in-memory record batches The provided schema should not have the projection applied.

Source

pub fn try_new_as_values( schema: SchemaRef, data: Vec<Vec<Arc<dyn PhysicalExpr>>>, ) -> Result<Arc<DataSourceExec>>

Create a new execution plan from a list of constant values (ValuesExec)

Source

pub fn try_new_from_batches( schema: SchemaRef, batches: Vec<RecordBatch>, ) -> Result<Arc<DataSourceExec>>

Create a new plan using the provided schema and batches.

Errors if any of the batches don’t match the provided schema, or if no batches are provided.

Source

pub fn with_limit(self, limit: Option<usize>) -> Self

Set the limit of the files

Source

pub fn with_show_sizes(self, show_sizes: bool) -> Self

Set show_sizes to determine whether to display partition sizes

Source

pub fn partitions(&self) -> &[Vec<RecordBatch>]

Ref to partitions

Source

pub fn projection(&self) -> &Option<Vec<usize>>

Ref to projection

Source

pub fn show_sizes(&self) -> bool

Show sizes

Source

pub fn sort_information(&self) -> &[LexOrdering]

Ref to sort information

Source

pub fn try_with_sort_information( self, sort_information: Vec<LexOrdering>, ) -> Result<Self>

A memory table can be ordered by multiple expressions simultaneously. EquivalenceProperties keeps track of expressions that describe the global ordering of the schema. These columns are not necessarily same; e.g.

┌-------┐
| a | b |
|---|---|
| 1 | 9 |
| 2 | 8 |
| 3 | 7 |
| 5 | 5 |
└---┴---┘

where both a ASC and b DESC can describe the table ordering. With EquivalenceProperties, we can keep track of these equivalences and treat a ASC and b DESC as the same ordering requirement.

Note that if there is an internal projection, that projection will be also applied to the given sort_information.

Source

pub fn original_schema(&self) -> SchemaRef

Arc clone of ref to original schema

Trait Implementations§

Source§

impl Clone for MemorySourceConfig

Source§

fn clone(&self) -> MemorySourceConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DataSource for MemorySourceConfig

Source§

fn repartitioned( &self, target_partitions: usize, _repartition_file_min_size: usize, output_ordering: Option<LexOrdering>, ) -> Result<Option<Arc<dyn DataSource>>>

If possible, redistribute batches across partitions according to their size.

Returns Ok(None) if unable to repartition. Preserve output ordering if exists. Refer to DataSource::repartitioned for further details.

Source§

fn open( &self, partition: usize, _context: Arc<TaskContext>, ) -> Result<SendableRecordBatchStream>

Source§

fn as_any(&self) -> &dyn Any

Source§

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

Format this source for display in explain plans
Source§

fn output_partitioning(&self) -> Partitioning

Source§

fn eq_properties(&self) -> EquivalenceProperties

Source§

fn statistics(&self) -> Result<Statistics>

Source§

fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn DataSource>>

Return a copy of this DataSource with a new fetch limit
Source§

fn fetch(&self) -> Option<usize>

Source§

fn try_swapping_with_projection( &self, projection: &ProjectionExec, ) -> Result<Option<Arc<dyn ExecutionPlan>>>

Source§

fn metrics(&self) -> ExecutionPlanMetricsSet

Source§

fn try_pushdown_filters( &self, filters: Vec<Arc<dyn PhysicalExpr>>, _config: &ConfigOptions, ) -> Result<FilterPushdownPropagation<Arc<dyn DataSource>>>

Try to push down filters into this DataSource. See ExecutionPlan::handle_child_pushdown_result for more details.
Source§

impl Debug for MemorySourceConfig

Source§

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

Formats the value using the given formatter. 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> ErasedDestructor for T
where T: 'static,