Skip to content

Commit eecb813

Browse files
committed
Use Parquet 2.0 format by default in CarpetWriter
1 parent 2dd6c5c commit eecb813

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

carpet-record/src/main/java/com/jerolba/carpet/CarpetWriter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
* A Parquet file writer for writing java records of type T to a file or output
4040
* stream. The writer is also a consumer that can be used with Java 8 streams.
4141
*
42+
* Creates a ParquetWriter with this configuration:
43+
*
44+
* <pre>{@code
45+
* .withWriteMode(Mode.OVERWRITE)
46+
* .withWriterVersion(WriterVersion.PARQUET_2_0)
47+
* .withCompressionCodec(CompressionCodecName.SNAPPY)
48+
*
49+
* }</pre>
50+
*
4251
* @param <T> The type of records to write.
4352
*/
4453
public class CarpetWriter<T> implements Closeable, Consumer<T> {
@@ -141,6 +150,7 @@ public static class Builder<T> {
141150
public Builder(OutputFile path, Class<T> recordClass) {
142151
builder = CarpetParquetWriter.builder(path, recordClass)
143152
.withWriteMode(Mode.OVERWRITE)
153+
.withWriterVersion(WriterVersion.PARQUET_2_0)
144154
.withCompressionCodec(CompressionCodecName.SNAPPY);
145155
}
146156

0 commit comments

Comments
 (0)