write
The write method will write a table to a standard Parquet file.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| table | Table | The table to write to file. |
| path | str | Path name of the file where the table will be stored. The file name should end with the |
| table_definition optional | TableDefinitionLike | The table definition to use for writing, instead of the definitions implied by the table. This definition can be used to skip some columns or add additional columns with null values. |
| col_instructions optional | list[ColumnInstruction] | One or more optional |
| compression_codec_name optional | str | The compression codec to use. Options are:
If not specified, defaults to |
| max_dictionary_keys optional | int | The maximum number of unique dictionary keys the writer is allowed to add to a dictionary page before switching to non-dictionary encoding. If not specified, the default value is 2^20 (1,048,576). |
| max_dictionary_size optional | int | The maximum number of bytes the writer should add to the dictionary before switching to non-dictionary encoding. If not specified, the default value is 2^20 (1,048,576). |
| target_page_size optional | int | The target page size in bytes. If not specified, defaults to 2^20 bytes (1 MiB). |
| generate_metadata_files optional | bool | Whether to generate Parquet |
| index_columns optional | Sequence[Sequence[str]] | Sequence of sequences containing the column names for indexes to persist. The write operation will store the index info for the provided columns as sidecar tables. For example, if the input is |
| row_group_info optional | RowGroupInfo | The Row Group configuration for writing. Available options are:
|
| special_instructions optional | s3.S3Instructions | Special instructions for writing Parquet files to S3 or other remote storage. See |
Returns
A Parquet file located in the specified path.
Examples
Note
All examples in this document write data to the /data directory in Deephaven. For more information on this directory and how it relates to your local file system, see Docker data volumes.
Single Parquet file
In this example, write writes the source table to /data/output.parquet.
Compression codec
In this example, write writes the source table /data/output_GZIP.parquet with GZIP compression.