Skip to content
Search
DSL · Parquet

to_parquet

Definition

/**
 * @param Path|string $path
 * @param null|Options $options - @deprecated use `withOptions` method instead
 * @param Compressions $compressions - @deprecated use `withCompressions` method instead
 * @param null|Schema $schema - @deprecated use `withSchema` method instead
 */
to_parquet(Path|string $path, ?Options $options, Compressions $compressions, ?Schema $schema) : ParquetLoader

Usage examples

<?php

declare(strict_types=1);

use function Flow\ETL\Adapter\Parquet\to_parquet;
use function Flow\ETL\DSL\{data_frame, from_array, overwrite};

require __DIR__ . '/vendor/autoload.php';

data_frame()
    ->read(from_array([
        ['id' => 1],
        ['id' => 2],
        ['id' => 3],
        ['id' => 4],
        ['id' => 5],
    ]))
    ->collect()
    ->saveMode(overwrite())
    ->write(to_parquet(__DIR__ . '/output.parquet'))
    ->run();

Contributors

Built in the open.

Join us on GitHub
scroll back to top