Flow PHP

SchemaInferrer

Read onlyYes
FinalYes

Methods

__construct()  : mixed
infer()  : Schema
The outer iterable must yield UNSTARTED inner iterables - a source is started only when it is first advanced; a source abandoned mid-way is closed by its producer, not here.
sniff()  : ColumnTypes

Methods

infer()

The outer iterable must yield UNSTARTED inner iterables - a source is started only when it is first advanced; a source abandoned mid-way is closed by its producer, not here.

public infer(array<int, string> $names, iterable<int, iterable<int, RawRowValues>> $sources) : Schema
Parameters
$names : array<int, string>
  • columns known before any row; [] when the format carries none (JSON)
$sources : iterable<int, iterable<int, RawRowValues>>
  • one inner iterable per source, in listing order. A source that lists no files yields exactly one. An empty outer iterable yields every name as ?string.
Return values
Schema

sniff()

public sniff(array<int, string> $names, iterable<int, RawRowValues$source, int<0, max>|-1 $rowBudget) : ColumnTypes
Parameters
$names : array<int, string>
  • columns known before any row; [] when the format carries none (JSON)
$source : iterable<int, RawRowValues>
  • one source's rows, unstarted
$rowBudget : int<0, max>|-1
  • rows to observe, 0 for none, -1 for all of them
Return values
ColumnTypes
On this page

Search results