parquetWrite
Write table or timeseries to a Parquet or Arrow file
Syntax
parquetWrite(filename, data) parquetWrite(filename, data, compression)
Arguments
- filename
Scalar string specifying the output file. Supported extensions are
.parquetand.arrow.- data
A table or timeseries containing the data to write.
- compression
Scalar string or string array specifying the compression algorithm for Parquet files. If a scalar string is provided, the compression applies to the entire file. If a string array (with length matching the number of variables) is provided, each element specifies the compression for the corresponding variable. Supported values are
"gzip"(default),"snappy","zstd"and"uncompressed".
Description
parquetWrite writes the contents of a table or timeseries to a Parquet
(.parquet) or Arrow (.arrow) file.
Each column of the file corresponds to a column of the table.
The name of the column are the same as in the table.
Examples
a = ["A"; "B"; "C"]; b = hours([1;3;5]); c = rand(3,1); t = table(a, b, c, "VariableNames", ["string", "hours", "double"]); parquetWrite(fullfile(TMPDIR, "data.parquet"), t) parquetRead(fullfile(TMPDIR, "data.parquet")) // t = [3x3 table] // // string hours double // ______ ________ _________ // // A 01:00:00 0.2113249 // B 03:00:00 0.7560439 // C 05:00:00 0.0002211
a = ["A"; "B"; "C"]; b = hours([1;3;5]); c = rand(3,1); ts = timeseries(b, a, c, "VariableNames", ["hours", "string", "double"]); parquetWrite(fullfile(TMPDIR, "data.parquet"), ts) ts2 = parquetRead(fullfile(TMPDIR, "data.parquet"), "OutputType", "timeseries") // ts2 = [3x2 timeseries] // // hours string double // ________ ______ _________ // // 01:00:00 A 0.2113249 // 03:00:00 B 0.7560439 // 05:00:00 C 0.0002211
See also
- parquetRead — Read a Parquet or Arrow file and return a table/timeseries.
- table — create a table from variables
- timeseries — create a timeseries - table with time as index
- datetime — create points in time
- duration — create a duration - duration in hours, minutes and seconds
History
| Versão | Descrição |
| 2027.0.0 | Add the optional |
| 2026.1.0 | Function added. |
| Report an issue | ||
| << parquetRead | Planilhas | read_csv >> |