CSVExtractor implements BatchableExtractor, Extractor, FileExtractor, InfersSchema, MetadataColumnsExtractor, CorruptedRecordsRouter, SplittableExtractor
FinalYes
Interfaces
- BatchableExtractor
- Extractor
- FileExtractor
- InfersSchema
- MetadataColumnsExtractor
- CorruptedRecordsRouter
- SplittableExtractor
Methods
- __construct() : mixed
- batchSize() : int<1, max>
- corruptedRecordsLoader() : Loader|null
- extract() : Generator<Signal|null, void>
- inferSchema() : static
- isRepeatable() : bool
- partitionSchema() : Schema
- partitionTypes() : static
- prunes() : bool
- reader() : FileSplitReader
- refresh() : void
- schema() : Schema
- source() : Path
- splits() : array<int, FileSplit>
- Byte windows over every admitted file, cut by arithmetic alone; the read resyncs both ends of a window to a record start (CSVRecordResync), so a quoted newline never splits a record and no record is read twice.
- statistics() : Statistics
- Rows come from the sample schema inference already read; without one they are unknown, a sniff is never run just for them.
- withBatchSize() : static
- withBOMRemoval() : self
- withCharactersReadInLine() : self
- withCorruptedRecords() : static
- withEmptyToNull() : self
- withEnclosure() : self
- withEscape() : self
- withHeader() : self
- withMetadataColumns() : static
- withMissingColumnsAsNull() : self
- withSchema() : static
- withSeparator() : self
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>corruptedRecordsLoader()
public
corruptedRecordsLoader() : Loader|null
Return values
Loader|nullextract()
public
extract(Backend $backend, Criteria $criteria) : Generator<Signal|null, void>
Parameters
- $backend : Backend
- $criteria : Criteria
Return values
Generator<Signal|null, void>inferSchema()
public
inferSchema(SchemaInferenceBuilder $builder) : static
Parameters
- $builder : SchemaInferenceBuilder
Return values
staticisRepeatable()
public
isRepeatable() : bool
Return values
boolpartitionSchema()
public
partitionSchema() : Schema
Return values
SchemapartitionTypes()
public
partitionTypes(PartitionTypes $types) : static
Parameters
- $types : PartitionTypes
Return values
staticprunes()
public
prunes(ScalarFunction $conjunct) : bool
Parameters
- $conjunct : ScalarFunction
Return values
boolreader()
public
reader() : FileSplitReader
Return values
FileSplitReaderrefresh()
public
refresh() : void
schema()
public
schema() : Schema
Return values
Schemasource()
public
source() : Path
Return values
Pathsplits()
Byte windows over every admitted file, cut by arithmetic alone; the read resyncs both ends of a window to a record start (CSVRecordResync), so a quoted newline never splits a record and no record is read twice.
public
splits(Criteria $criteria, int $targetSplitBytes) : array<int, FileSplit>
Parameters
- $criteria : Criteria
- $targetSplitBytes : int
Return values
array<int, FileSplit>statistics()
Rows come from the sample schema inference already read; without one they are unknown, a sniff is never run just for them.
public
statistics() : Statistics
Return values
StatisticswithBatchSize()
public
withBatchSize(int $batchSize) : static
Parameters
- $batchSize : int
Return values
staticwithBOMRemoval()
public
withBOMRemoval(bool $removeBOM) : self
Parameters
- $removeBOM : bool
Return values
selfwithCharactersReadInLine()
public
withCharactersReadInLine(int $charactersReadInLine) : self
Parameters
- $charactersReadInLine : int
-
- bytes read per step from a remote stream (S3, Azure); never splits a line
Return values
selfwithCorruptedRecords()
public
withCorruptedRecords(Loader|null $loader) : static
Parameters
- $loader : Loader|null
Return values
staticwithEmptyToNull()
public
withEmptyToNull(bool $emptyToNull) : self
Parameters
- $emptyToNull : bool
Return values
selfwithEnclosure()
public
withEnclosure(string $enclosure) : self
Parameters
- $enclosure : string
Return values
selfwithEscape()
public
withEscape(string $escape) : self
Parameters
- $escape : string
Return values
selfwithHeader()
public
withHeader(bool $withHeader) : self
Parameters
- $withHeader : bool
Return values
selfwithMetadataColumns()
public
withMetadataColumns(bool $addMetadataColumns) : static
Parameters
- $addMetadataColumns : bool
Return values
staticwithMissingColumnsAsNull()
public
withMissingColumnsAsNull(bool $missingColumnsAsNull) : self
Parameters
- $missingColumnsAsNull : bool
Return values
selfwithSchema()
public
withSchema(Schema $schema) : static
Parameters
- $schema : Schema
Return values
staticwithSeparator()
public
withSeparator(string $separator) : self
Parameters
- $separator : string