pub struct MemorySourceConfig { /* private fields */ }Expand description
Data source configuration for reading in-memory batches of data
Implementations§
Source§impl MemorySourceConfig
impl MemorySourceConfig
Sourcepub fn try_new(
partitions: &[Vec<RecordBatch>],
schema: SchemaRef,
projection: Option<Vec<usize>>,
) -> Result<Self>
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.
Sourcepub fn try_new_exec(
partitions: &[Vec<RecordBatch>],
schema: SchemaRef,
projection: Option<Vec<usize>>,
) -> Result<Arc<DataSourceExec>>
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.
Sourcepub fn try_new_as_values(
schema: SchemaRef,
data: Vec<Vec<Arc<dyn PhysicalExpr>>>,
) -> Result<Arc<DataSourceExec>>
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)
Sourcepub fn try_new_from_batches(
schema: SchemaRef,
batches: Vec<RecordBatch>,
) -> Result<Arc<DataSourceExec>>
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.
Sourcepub fn with_limit(self, limit: Option<usize>) -> Self
pub fn with_limit(self, limit: Option<usize>) -> Self
Set the limit of the files
Sourcepub fn with_show_sizes(self, show_sizes: bool) -> Self
pub fn with_show_sizes(self, show_sizes: bool) -> Self
Set show_sizes to determine whether to display partition sizes
Sourcepub fn partitions(&self) -> &[Vec<RecordBatch>]
pub fn partitions(&self) -> &[Vec<RecordBatch>]
Ref to partitions
Sourcepub fn projection(&self) -> &Option<Vec<usize>>
pub fn projection(&self) -> &Option<Vec<usize>>
Ref to projection
Sourcepub fn show_sizes(&self) -> bool
pub fn show_sizes(&self) -> bool
Show sizes
Sourcepub fn sort_information(&self) -> &[LexOrdering]
pub fn sort_information(&self) -> &[LexOrdering]
Ref to sort information
Sourcepub fn try_with_sort_information(
self,
sort_information: Vec<LexOrdering>,
) -> Result<Self>
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.
Sourcepub fn original_schema(&self) -> SchemaRef
pub fn original_schema(&self) -> SchemaRef
Arc clone of ref to original schema
Trait Implementations§
Source§impl Clone for MemorySourceConfig
impl Clone for MemorySourceConfig
Source§fn clone(&self) -> MemorySourceConfig
fn clone(&self) -> MemorySourceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataSource for MemorySourceConfig
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>>>
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.
fn open( &self, partition: usize, _context: Arc<TaskContext>, ) -> Result<SendableRecordBatchStream>
fn as_any(&self) -> &dyn Any
Source§fn fmt_as(&self, t: DisplayFormatType, f: &mut Formatter<'_>) -> Result
fn fmt_as(&self, t: DisplayFormatType, f: &mut Formatter<'_>) -> Result
fn output_partitioning(&self) -> Partitioning
fn eq_properties(&self) -> EquivalenceProperties
fn scheduling_type(&self) -> SchedulingType
fn statistics(&self) -> Result<Statistics>
Source§fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn DataSource>>
fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn DataSource>>
fn fetch(&self) -> Option<usize>
fn try_swapping_with_projection( &self, projection: &[ProjectionExpr], ) -> Result<Option<Arc<dyn DataSource>>>
fn metrics(&self) -> ExecutionPlanMetricsSet
Source§fn try_pushdown_filters(
&self,
filters: Vec<Arc<dyn PhysicalExpr>>,
_config: &ConfigOptions,
) -> Result<FilterPushdownPropagation<Arc<dyn DataSource>>>
fn try_pushdown_filters( &self, filters: Vec<Arc<dyn PhysicalExpr>>, _config: &ConfigOptions, ) -> Result<FilterPushdownPropagation<Arc<dyn DataSource>>>
ExecutionPlan::handle_child_pushdown_result for more details.Auto Trait Implementations§
impl Freeze for MemorySourceConfig
impl !RefUnwindSafe for MemorySourceConfig
impl Send for MemorySourceConfig
impl Sync for MemorySourceConfig
impl Unpin for MemorySourceConfig
impl !UnwindSafe for MemorySourceConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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