FilesExtractor implements BatchableExtractor, Extractor, FileExtractor, LimitPushDown, RewindableExtractor uses Batches, PathFiltering, PushesLimit
FinalYes
Interfaces
- BatchableExtractor
- A source that decides how many rows it puts in one Rows. withBatchSize() bounds what the source BUILDS; batches() re-slices what a source already emitted and cannot lower its peak.
- Extractor
- FileExtractor
- LimitPushDown
- A source that can read fewer rows when the plan has a LIMIT above it. This is an optimization hint, never a guarantee: the limit operator stays in the plan and enforces the exact count, so an implementation that yields more rows than asked - or ignores the hint - is still correct.
- RewindableExtractor
- A rewindable extractor can be read more than once and yield the same rows each time, so a build-time pass may scan it before extraction without consuming it.
Methods
- __construct() : mixed
- batchSize() : int<1, max>
- extract() : Generator<Signal|null, void>
- Yields rows in batches. When the source is a BatchableExtractor a batch holds between 0 and that extractor's own batchSize() rows; the size is chosen by the extractor and MAY vary between batches. Consumers must not assume a minimum size, a constant size, or a non-empty batch.
- filter() : Filter
- isRepeatable() : bool
- partitionNames() : array<string, bool>
- pushedLimit() : int|null
- pushLimit() : void
- schema() : Schema
- Answers before extract() runs, so every batch it yields carries this shape. Takes no FlowContext: a source that needs the pipeline's context to describe itself has not moved the answer to bind time.
- source() : Path
- withBatchSize() : static
- withPathFilter() : static
- withSchema() : static
- Declares the shape every yielded batch must carry. A source that describes itself uses this instead of its own description, and values are cast to fit.
Methods
__construct()
public
__construct(Path $path[, Filesystem $filesystem = new NativeLocalFilesystem() ]) : mixed
Parameters
- $path : Path
- $filesystem : Filesystem = new NativeLocalFilesystem()
batchSize()
public
batchSize() : int<1, max>
Return values
int<1, max>extract()
Yields rows in batches. When the source is a BatchableExtractor a batch holds between 0 and that extractor's own batchSize() rows; the size is chosen by the extractor and MAY vary between batches. Consumers must not assume a minimum size, a constant size, or a non-empty batch.
public
extract(FlowContext $context) : Generator<Signal|null, void>
Parameters
- $context : FlowContext
Return values
Generator<Signal|null, void>filter()
public
filter() : Filter
Return values
FilterisRepeatable()
public
isRepeatable() : bool
Return values
boolpartitionNames()
public
partitionNames(PartitionColumns $partitionColumns, Path $path) : array<string, bool>
Parameters
- $partitionColumns : PartitionColumns
- $path : Path
Return values
array<string, bool>pushedLimit()
public
pushedLimit() : int|null
Return values
int|nullpushLimit()
public
pushLimit(int $limit) : void
Parameters
- $limit : int
schema()
Answers before extract() runs, so every batch it yields carries this shape. Takes no FlowContext: a source that needs the pipeline's context to describe itself has not moved the answer to bind time.
public
schema() : Schema
Return values
Schemasource()
public
source() : Path
Return values
PathwithBatchSize()
public
withBatchSize(int $batchSize) : static
Parameters
- $batchSize : int
Return values
staticwithPathFilter()
public
withPathFilter(Filter $filter) : static
Parameters
- $filter : Filter
Return values
staticwithSchema()
Declares the shape every yielded batch must carry. A source that describes itself uses this instead of its own description, and values are cast to fit.
public
withSchema(Schema $schema) : static
Parameters
- $schema : Schema