PartitionColumns
Methods
- __construct() : mixed
- apply() : Rows
- Inference sees one stream at a time, so it types a partition column from that stream alone - `string` where the path carries it, `?null` where it does not, and the two batches then refuse to merge. The path knows better than the values do, so here the partition definition wins.
- declare() : Schema
- A partition column keeps the type its declared definition gives it, but never its body position: it is removed from wherever the file put it and re-appended in the partition block, so a declared read and an undeclared one emit the same column order.
- fill() : array<string|int, mixed>
- names() : array<string, bool>
- One read yields one Schema, so a partition column that only some paths under the listing carry still has to be declared for all of them - and it is nullable when some path lacks it, or when some path carries the Hive null sentinel, which is a value the column has to be able to hold.
Methods
__construct()
public
__construct(Filesystem $filesystem) : mixed
Parameters
- $filesystem : Filesystem
apply()
Inference sees one stream at a time, so it types a partition column from that stream alone - `string` where the path carries it, `?null` where it does not, and the two batches then refuse to merge. The path knows better than the values do, so here the partition definition wins.
public
apply(Rows $rows, array<string, bool> $names[, PartitionTypes $types = new PartitionTypes() ]) : Rows
Parameters
- $rows : Rows
- $names : array<string, bool>
- $types : PartitionTypes = new PartitionTypes()
Return values
Rowsdeclare()
A partition column keeps the type its declared definition gives it, but never its body position: it is removed from wherever the file put it and re-appended in the partition block, so a declared read and an undeclared one emit the same column order.
public
declare(Schema $schema, array<string, bool> $names[, PartitionTypes $types = new PartitionTypes() ]) : Schema
Parameters
- $schema : Schema
- $names : array<string, bool>
- $types : PartitionTypes = new PartitionTypes()
Return values
Schemafill()
public
fill(array<string|int, mixed> $row, array<string|int, bool> $names, array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $row : array<string|int, mixed>
- $names : array<string|int, bool>
- $values : array<string|int, mixed>
-
partition name => value, for the path this row came from
Return values
array<string|int, mixed>names()
One read yields one Schema, so a partition column that only some paths under the listing carry still has to be declared for all of them - and it is nullable when some path lacks it, or when some path carries the Hive null sentinel, which is a value the column has to be able to hold.
public
names(Path $path, Filter $filter) : array<string, bool>
Partition values live in the path, so both the union and its nullability are known without opening a single file.
Parameters
- $path : Path
- $filter : Filter
Return values
array<string, bool> —partition name => nullable