parquetwrite
Write a table to a Parquet file.
📝Syntax
parquetwrite(filename, T)
parquetwrite(filename, T, Name, Value)
📥Input Arguments
Parameter Description
filename a string: destination Parquet file.
T a table or timetable.
Name, Value optional arguments specified as name-value pairs.
📄Description

parquetwrite(filename, T) writes the table or timetable T to a local Parquet file.

Supported variable types include logical values, integer types, single and double precision floating point values, text, datetime values, duration values, nested tables, and homogeneous primitive cell vector columns.

Unsupported variables such as complex arrays, sparse arrays, unsupported class objects, and unsupported nested cell shapes generate an error.

Supported name-value pairs are VariableCompression, VariableEncoding, VariableNames, RowGroupHeights, and Version.

VariableCompression accepts values such as 'snappy', 'gzip', 'brotli', 'zstd', 'lz4', and 'uncompressed'. VariableEncoding accepts 'auto', 'plain', or 'dictionary'. Version accepts '1.0', '2.4', or '2.6'.

💡Examples
filename = [tempdir(), 'doc_parquetwrite.parquet'];
T = table(int32([1; 2; 3]), single([1.5; 2.5; 3.5]), logical([true; false; true]), ...
  ["A"; "B"; "C"], 'VariableNames', {'Id', 'Value', 'Flag', 'Name'});
parquetwrite(filename, T);
R = parquetread(filename)
filename = [tempdir(), 'doc_parquetwrite_rowgroups.parquet'];
T = table((1:6)', [10; 20; 30; 40; 50; 60], 'VariableNames', {'Id', 'Value'});
parquetwrite(filename, T, 'RowGroupHeights', 2, 'VariableCompression', 'gzip');
info = parquetinfo(filename);
info.NumRowGroups
filename = [tempdir(), 'doc_parquetwrite_nested.parquet'];
Nested = table(int16([10; 20; 30]), [1.5; 2.5; 3.5], 'VariableNames', {'Code', 'Value'});
T = table((1:3)', Nested, 'VariableNames', {'Id', 'Nested'});
parquetwrite(filename, T);
R = parquetread(filename);
R.Nested
🔗See Also
parquetreadparquetinfotable
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub