Skip to content

Commit 8511e64

Browse files
committed
add setter to ParquetWriter.Builder
1 parent 42c3d1f commit 8511e64

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,24 @@ public SELF withSizeStatisticsEnabled(boolean enabled) {
976976
return self();
977977
}
978978

979+
/**
980+
* Sets whether to write the path_in_schema field in ColumnMetaData.
981+
*
982+
* The path_in_schema field in the Thrift metadata is redundant and wastes a great
983+
* deal of space. Parquet file footers can be made much smaller by omitting this field.
984+
* Because the field was originally a mandatory field, this property defaults to true
985+
* to maintain compatibility with older readers that expect this field to be present.
986+
* If one knows that all readers one plans to use are tolerant of the absense of this field,
987+
* this may be safely set to false.
988+
*
989+
* @param enabled whether to write path_in_schema
990+
* @returnthis builder for method chaining
991+
*/
992+
public SELF withWritePathInSchemaEnabled(boolean enabled) {
993+
encodingPropsBuilder.withWritePathInSchemaEnabled(enabled);
994+
return self();
995+
}
996+
979997
/**
980998
* Build a {@link ParquetWriter} with the accumulated configuration.
981999
*

0 commit comments

Comments
 (0)