Rows implements Countable
Interfaces
- Countable
Methods
- adoptedBy() : self
- The same batch with every column in $backend's storage - itself when $backend already owns every column.
- castTo() : self
- Every column cast to $schema's definition, absent ones as nulls.
- chunks() : Generator<int, Rows>
- column() : Column
- columns() : array<string|int, Column>
- concat() : self
- Every part carries $schema; zero-row parts add no rows, and no parts give an empty batch. The result's columns are $backend's.
- count() : int
- drop() : self
- dropRight() : self
- empty() : self
- fromColumns() : self
- gather() : self
- isEmpty() : bool
- matchTo() : self
- Adopts $schema. A changed column whose type change the types prove is restamped; any other change is checked value by value and rebuilt in $backend.
- nulls() : self
- One row, every column of $schema null (and declared nullable).
- project() : self
- Drops the columns $schema does not declare and adopts it, converting a kept column whose definition $schema changes (in $backend). Contrast select(), which keeps the named columns as they are. Widening the batch with columns it lacks is not a projection - that goes through matchTo().
- reduceToArray() : array<int, mixed>
- remove() : self
- schema() : Schema
- select() : self
- The named columns as they are, in schema order - every column kept unconverted, in whatever backend built it.
- slice() : self
- take() : self
- toArray() : array<int, array<string|int, mixed>>
- values() : array<string|int, mixed>
- withColumns() : self
- withSchema() : self
- Positional restamp: the n-th definition of $schema retypes the n-th column (Column::withType).
Methods
adoptedBy()
The same batch with every column in $backend's storage - itself when $backend already owns every column.
public
adoptedBy(Backend $backend) : self
Parameters
- $backend : Backend
Tags
Return values
selfcastTo()
Every column cast to $schema's definition, absent ones as nulls.
public
castTo(Schema $schema, Backend $backend) : self
Parameters
Return values
selfchunks()
public
chunks(int<1, max> $size) : Generator<int, Rows>
Parameters
- $size : int<1, max>
Return values
Generator<int, Rows>column()
public
column(string $name) : Column
Parameters
- $name : string
Tags
Return values
Columncolumns()
public
columns() : array<string|int, Column>
Return values
array<string|int, Column> —schema order
concat()
Every part carries $schema; zero-row parts add no rows, and no parts give an empty batch. The result's columns are $backend's.
public
static concat(Schema $schema, Backend $backend, self ...$parts) : self
Parameters
Tags
Return values
selfcount()
public
count() : int
Return values
intdrop()
public
drop(int $size) : self
Parameters
- $size : int
Return values
selfdropRight()
public
dropRight(int $size) : self
Parameters
- $size : int
Return values
selfempty()
public
static empty(Schema $schema, Backend $backend) : self
Parameters
Return values
selffromColumns()
public
static fromColumns(Schema $schema, array<string|int, Column> $columns, int $count) : self
Parameters
- $schema : Schema
- $columns : array<string|int, Column>
-
keyed and ordered by $schema, every one of $count rows
- $count : int
Tags
Return values
selfgather()
public
gather(array<int, int> $indices) : self
Parameters
- $indices : array<int, int>
-
rows to keep, in the order given
Tags
Return values
selfisEmpty()
public
isEmpty() : bool
Return values
boolmatchTo()
Adopts $schema. A changed column whose type change the types prove is restamped; any other change is checked value by value and rebuilt in $backend.
public
matchTo(Schema $schema, Backend $backend) : self
Parameters
Tags
Return values
selfnulls()
One row, every column of $schema null (and declared nullable).
public
static nulls(Schema $schema, Backend $backend) : self
Parameters
Return values
selfproject()
Drops the columns $schema does not declare and adopts it, converting a kept column whose definition $schema changes (in $backend). Contrast select(), which keeps the named columns as they are. Widening the batch with columns it lacks is not a projection - that goes through matchTo().
public
project(Schema $schema, Backend $backend) : self
Parameters
Tags
Return values
selfreduceToArray()
public
reduceToArray(string $name) : array<int, mixed>
Parameters
- $name : string
Tags
Return values
array<int, mixed>remove()
public
remove(int $offset) : self
Parameters
- $offset : int
Return values
selfschema()
public
schema() : Schema
Return values
Schemaselect()
The named columns as they are, in schema order - every column kept unconverted, in whatever backend built it.
public
select(string ...$names) : self
Contrast project(), which adopts a given schema and converts the columns it changes.
Parameters
- $names : string
Tags
Return values
selfslice()
public
slice(int $offset, int $length) : self
Parameters
- $offset : int
- $length : int
Tags
Return values
selftake()
public
take(int $size) : self
Parameters
- $size : int
Return values
selftoArray()
public
toArray([bool $withKeys = true ]) : array<int, array<string|int, mixed>>
Parameters
- $withKeys : bool = true
Return values
array<int, array<string|int, mixed>>values()
public
values(int $i) : array<string|int, mixed>
Parameters
- $i : int
Tags
Return values
array<string|int, mixed> —the logical row, schema order
withColumns()
public
withColumns(Schema $schema, array<string|int, Column> $columns) : self
Parameters
- $schema : Schema
- $columns : array<string|int, Column>
-
each of count() rows; a same-named column is replaced in place
Tags
Return values
selfwithSchema()
Positional restamp: the n-th definition of $schema retypes the n-th column (Column::withType).
public
withSchema(Schema $schema) : self
Parameters
- $schema : Schema