SchemaInference
Read onlyYes
FinalYes
Properties
- $filesToSniff : int|null
- $sampleSize : int|null
- $sniffs : Sniffs|null
- $types : InferredTypes|null
- $unionByName : bool
Methods
- __construct() : mixed
- candidates() : InferredTypes
- everyRow() : self
- everySource() : self
- fromArray() : self
-
normalize()
: array{sample_size: null|int, files_to_sniff: null|int, types: null|list
>, union_by_name: bool}
Properties
$filesToSniff
public
int|null
$filesToSniff
= 10
$sampleSize
public
int|null
$sampleSize
= 20480
$sniffs
public
Sniffs|null
$sniffs
= null
$types
public
InferredTypes|null
$types
= null
$unionByName
public
bool
$unionByName
= false
Methods
__construct()
public
__construct([null|int<1, max> $sampleSize = 20480 ][, null|int<1, max> $filesToSniff = 10 ][, null|InferredTypes $types = null ][, bool $unionByName = false ][, null|Sniffs $sniffs = null ]) : mixed
Parameters
- $sampleSize : null|int<1, max> = 20480
-
- rows observed across every sampled source before the schema is frozen; null observes every row, see everyRow()
- $filesToSniff : null|int<1, max> = 10
-
- sources that yielded a row, counted while the row budget is not spent; null sniffs every source, see everySource()
- $types : null|InferredTypes = null
-
- the types inference may produce; null is every type but markup
- $unionByName : bool = false
-
- false takes the column set from the first source and treats a later source's unseen column as a divergence; true unions the sets and runs no divergence check
- $sniffs : null|Sniffs = null
-
- runs the whole-unit sniffs of everyRow(); null sniffs in this process; a live collaborator, never normalized
Tags
candidates()
public
candidates() : InferredTypes
Return values
InferredTypeseveryRow()
public
everyRow() : self
Return values
selfeverySource()
public
everySource() : self
Return values
selffromArray()
public
static fromArray(array<string|int, mixed> $data) : self
Parameters
- $data : array<string|int, mixed>
-
the shape of normalize()
Return values
selfnormalize()
public
normalize() : array{sample_size: null|int, files_to_sniff: null|int, types: null|list>, union_by_name: bool}