@@ -169,11 +169,44 @@ public ParquetWriter(
169169 boolean validating ,
170170 WriterVersion writerVersion ,
171171 Configuration conf ) throws IOException {
172+ this (file , ParquetFileWriter .Mode .CREATE , writeSupport ,
173+ compressionCodecName , blockSize , pageSize , dictionaryPageSize ,
174+ enableDictionary , validating , writerVersion , conf );
175+ }
176+ /**
177+ * Create a new ParquetWriter.
178+ *
179+ * @param file the file to create
180+ * @param mode file creation mode
181+ * @param writeSupport the implementation to write a record to a RecordConsumer
182+ * @param compressionCodecName the compression codec to use
183+ * @param blockSize the block size threshold
184+ * @param pageSize the page size threshold
185+ * @param dictionaryPageSize the page size threshold for the dictionary pages
186+ * @param enableDictionary to turn dictionary encoding on
187+ * @param validating to turn on validation using the schema
188+ * @param writerVersion version of parquetWriter from {@link ParquetProperties.WriterVersion}
189+ * @param conf Hadoop configuration to use while accessing the filesystem
190+ * @throws IOException
191+ */
192+ public ParquetWriter (
193+ Path file ,
194+ ParquetFileWriter .Mode mode ,
195+ WriteSupport <T > writeSupport ,
196+ CompressionCodecName compressionCodecName ,
197+ int blockSize ,
198+ int pageSize ,
199+ int dictionaryPageSize ,
200+ boolean enableDictionary ,
201+ boolean validating ,
202+ WriterVersion writerVersion ,
203+ Configuration conf ) throws IOException {
172204
173205 WriteSupport .WriteContext writeContext = writeSupport .init (conf );
174206 MessageType schema = writeContext .getSchema ();
175207
176- ParquetFileWriter fileWriter = new ParquetFileWriter (conf , schema , file );
208+ ParquetFileWriter fileWriter = new ParquetFileWriter (conf , schema , file ,
209+ mode );
177210 fileWriter .start ();
178211
179212 CodecFactory codecFactory = new CodecFactory (conf );
0 commit comments