pub struct DynamicScan {
pub schema: SchemaRef,
pub file_type: FileType,
pub base_url: Url,
pub file_constant_columns: Vec<String>,
pub path_column: ColumnName,
pub file_size_column: ColumnName,
pub last_modified_column: ColumnName,
pub dv_column: ColumnName,
}declarative-plans only.Expand description
Reads data files from an upstream stream of file-metadata tuples, one input row per file.
For each row, the path, size, and last-modified columns describe the file; the engine resolves
its path against base_url (see below), opens it as file_type, and reads columns matching
schema.
file_constant_columns lists upstream columns whose per-file values are broadcast onto
every emitted file row. This is file-constant metadata, the same concept as
ScanParquet::file_constant_columns. Each named input field must have the same type and
nullability as its output field. See the example below.
dv_column names a nullable column on the upstream row holding a Delta
DeletionVectorDescriptor struct. The engine resolves it into a roaring bitmap
and drops file rows whose row index appears in the DV. A NULL value for a given
input row means “no DV for this file”, so all file rows are emitted.
Each path value is resolved against base_url via Url::join. URL-reference resolution need
not stay under base_url: a different-scheme absolute URL replaces the base, while a value
starting with / or // replaces its path or authority.
Output row order is unspecified: the engine is free to read files in any order, in parallel, and to interleave rows from different files. The relative order of upstream rows is not preserved.
§Example
Given an upstream metadata stream and a DynamicScan configuration:
upstream (metadata)
path | size | filemod | version | dv
-----------------+------+---------+---------+------
part-0.parquet | 1024 | 100000 | 7 | NULL
part-1.parquet | 2048 | 200000 | 8 | NULLDynamicScan {
schema: { id: int, name: string, version: long },
file_type: Parquet,
base_url: "s3://table/",
file_constant_columns: ["version"],
path_column: "path",
file_size_column: "size",
last_modified_column: "filemod",
dv_column: "dv",
}The engine opens s3://table/part-0.parquet and s3://table/part-1.parquet, reads
{id, name} from each, sees a NULL DV for each file so all rows survive, and
broadcasts the row’s version onto every emitted file row. One possible output
(row order is not guaranteed):
| id | name | version
+----+------+--------
| 3 | c | 8
| 2 | b | 7
| 4 | d | 8
| 1 | a | 7Fields§
§schema: SchemaRef§file_type: FileType§base_url: UrlHierarchical base URL ending in / against which per-row path values resolve.
file_constant_columns: Vec<String>§path_column: ColumnNameNon-nullable input column holding the per-row file path or URL fragment.
file_size_column: ColumnNameNon-nullable input column with the file’s total size in bytes.
last_modified_column: ColumnNameNon-nullable input column with the last-modified timestamp in milliseconds since epoch.
dv_column: ColumnNameNullable input column with the schema of DeletionVectorDescriptor.
Implementations§
Source§impl DynamicScan
impl DynamicScan
Sourcepub fn try_new(
input_schema: &SchemaRef,
output_schema: impl Into<SchemaRef>,
file_type: FileType,
base_url: Url,
file_constant_columns: impl IntoIterator<Item = impl Into<String>>,
path_column: ColumnName,
file_size_column: ColumnName,
last_modified_column: ColumnName,
dv_column: ColumnName,
) -> DeltaResult<Self>
pub fn try_new( input_schema: &SchemaRef, output_schema: impl Into<SchemaRef>, file_type: FileType, base_url: Url, file_constant_columns: impl IntoIterator<Item = impl Into<String>>, path_column: ColumnName, file_size_column: ColumnName, last_modified_column: ColumnName, dv_column: ColumnName, ) -> DeltaResult<Self>
Constructs a DynamicScan whose emitted rows match output_schema.
input_schema describes the upstream rows containing file metadata. The scan reads
file_type files relative to base_url.
§Errors
Returns an error when base_url is not hierarchical or does not end in /; when a required
metadata or deletion-vector column is absent from input_schema, has an incompatible type,
or has invalid nullability; or when a file-constant column is absent from either schema, is
a metadata column, or has different input and output types or nullability.
Sourcepub fn validate_input(&self, input_schema: &SchemaRef) -> DeltaResult<()>
pub fn validate_input(&self, input_schema: &SchemaRef) -> DeltaResult<()>
Validates the columns consumed by this scan against an upstream input_schema.
Returns Ok(()) when the base URL is valid and every configured column resolves with the
required type and nullability.
§Errors
Returns an error when base_url is not hierarchical or does not end in /; when a required
metadata or deletion-vector column is absent, has an incompatible type, or has invalid
nullability; or when a file-constant column is absent from either schema, is a metadata
column, or has different input and output types or nullability.
Trait Implementations§
Source§impl Clone for DynamicScan
impl Clone for DynamicScan
Source§fn clone(&self) -> DynamicScan
fn clone(&self) -> DynamicScan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DynamicScan
impl Debug for DynamicScan
Source§impl From<&DynamicScan> for DynamicScanNode
impl From<&DynamicScan> for DynamicScanNode
Source§fn from(node: &DynamicScan) -> Self
fn from(node: &DynamicScan) -> Self
Source§impl From<DynamicScan> for Operator
impl From<DynamicScan> for Operator
Source§fn from(payload: DynamicScan) -> Self
fn from(payload: DynamicScan) -> Self
Auto Trait Implementations§
impl Freeze for DynamicScan
impl RefUnwindSafe for DynamicScan
impl Send for DynamicScan
impl Sync for DynamicScan
impl Unpin for DynamicScan
impl UnsafeUnpin for DynamicScan
impl UnwindSafe for DynamicScan
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> AsAny for T
impl<T> AsAny for T
Source§fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
dyn Any reference to the object: Read moreSource§fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
Arc<dyn Any> reference to the object: Read moreSource§fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
Box<dyn Any>: Read moreSource§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
std::any::type_name, since Any does not provide it and
Any::type_id is useless as a debugging aid (its Debug is just a mess of hex digits).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> FoldWithOption for T
impl<T> FoldWithOption for T
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
Source§fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
arrow-conversion and (crate features arrow-conversion or declarative-plans or default-engine-base) only.Source§impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
Source§fn try_into_kernel(self) -> Result<KernelType, ArrowError>
fn try_into_kernel(self) -> Result<KernelType, ArrowError>
arrow-conversion and (crate features arrow-conversion or declarative-plans or default-engine-base) only.