CSVOpenSource
Methods
- batches() : Iterator<int, CorruptedRecordException|Rows>
- Batches of exactly $batchSize rows (the last may be shorter), keyed and ordered by $schema, and every corrupted record handed up in record order. This instance is consumed afterwards.
- close() : void
- columns() : array<int, string>
- This instance is consumed afterwards.
- headers() : array<int, string>
- The header records() resolved; [] before it ran or for a 0-byte source.
- producedBytes() : int<0, max>
- The bytes, as read, of the rows producedRows() counts: line endings included, the header record excluded.
- producedRows() : int<0, max>
- Rows read from the source so far by records() or sniff() - it may be more than a consumer took.
- records() : Iterator<int, array<string|int, string|null>>
- The rows of the records that are not corrupted. This instance is consumed afterwards.
- sniff() : ColumnTypes
- ColumnTypes::sniff() over records(). This instance is consumed afterwards.
Methods
batches()
Batches of exactly $batchSize rows (the last may be shorter), keyed and ordered by $schema, and every corrupted record handed up in record order. This instance is consumed afterwards.
public
batches(Schema $schema, int<1, max> $batchSize, Backend $backend[, null|SchemaInference $inference = null ]) : Iterator<int, CorruptedRecordException|Rows>
Parameters
- $schema : Schema
- $batchSize : int<1, max>
- $backend : Backend
- $inference : null|SchemaInference = null
-
the inference that made $schema; null when it was declared
Tags
Return values
Iterator<int, CorruptedRecordException|Rows>close()
public
close() : void
columns()
This instance is consumed afterwards.
public
columns() : array<int, string>
Return values
array<int, string>headers()
The header records() resolved; [] before it ran or for a 0-byte source.
public
headers() : array<int, string>
Return values
array<int, string>producedBytes()
The bytes, as read, of the rows producedRows() counts: line endings included, the header record excluded.
public
producedBytes() : int<0, max>
Return values
int<0, max>producedRows()
Rows read from the source so far by records() or sniff() - it may be more than a consumer took.
public
producedRows() : int<0, max>
Return values
int<0, max>records()
The rows of the records that are not corrupted. This instance is consumed afterwards.
public
records() : Iterator<int, array<string|int, string|null>>
Return values
Iterator<int, array<string|int, string|null>>sniff()
ColumnTypes::sniff() over records(). This instance is consumed afterwards.
public
sniff(array<int, string> $names, null|int<0, max> $rowBudget, TypeNarrower $typer) : ColumnTypes
Parameters
- $names : array<int, string>
- $rowBudget : null|int<0, max>
-
- null for every row
- $typer : TypeNarrower