Writer
FinalYes
Methods
- __construct() : mixed
- __destruct() : mixed
- close() : void
- isOpen() : bool
- open() : void
- openForStream() : void
- Opens a writer for an existing stream.
- write() : void
- Create new parquet file, write rows, write metadata and close the file.
- writeBatch() : void
- Write a batch of rows into a parquet file.
- writeRow() : void
- Write a single row into a parquet file.
- writeStream() : void
- Create new parquet file directly in stream, write rows, write metadata and close the file.
Methods
__construct()
public
__construct([Compressions $compression = Compressions::SNAPPY ][, Options $options = new Options() ]) : mixed
Parameters
- $compression : Compressions = Compressions::SNAPPY
- $options : Options = new Options()
__destruct()
public
__destruct() : mixed
close()
public
close() : void
isOpen()
public
isOpen() : bool
Return values
boolopen()
public
open(string $path, Schema $schema) : void
Parameters
- $path : string
- $schema : Schema
openForStream()
Opens a writer for an existing stream.
public
openForStream(DestinationStream $stream, Schema $schema) : void
Parameters
- $stream : DestinationStream
- $schema : Schema
write()
Create new parquet file, write rows, write metadata and close the file.
public
write(string $path, Schema $schema, iterable<string|int, array<string, mixed>> $rows) : void
Parameters
- $path : string
- $schema : Schema
- $rows : iterable<string|int, array<string, mixed>>
writeBatch()
Write a batch of rows into a parquet file.
public
writeBatch(iterable<string|int, array<string, mixed>> $rows) : void
Before using this method, you should call open() or openForStream() method to open the writer. Once all rows are written, you should call close() method to close the writer.
Parameters
- $rows : iterable<string|int, array<string, mixed>>
writeRow()
Write a single row into a parquet file.
public
writeRow(array<string, mixed> $row) : void
Before using this method, you should call open() or openForStream() method to open the writer. Once all rows are written, you should call close() method to close the writer.
Parameters
- $row : array<string, mixed>
writeStream()
Create new parquet file directly in stream, write rows, write metadata and close the file.
public
writeStream(DestinationStream $resource, Schema $schema, iterable<string|int, array<string, mixed>> $rows) : void
Parameters
- $resource : DestinationStream
- $schema : Schema
- $rows : iterable<string|int, array<string, mixed>>