[ 
https://issues.apache.org/jira/browse/PARQUET-2385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17789879#comment-17789879
 ] 

ASF GitHub Bot commented on PARQUET-2385:
-----------------------------------------

wgtmac commented on code in PR #1203:
URL: https://github.com/apache/parquet-mr/pull/1203#discussion_r1405536183


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java:
##########
@@ -303,6 +303,32 @@ public ParquetWriter(Path file, Configuration conf, 
WriteSupport<T> writeSupport
       int maxPaddingSize,
       ParquetProperties encodingProps,
       FileEncryptionProperties encryptionProperties) throws IOException {
+    this(
+      file,
+      mode,
+      writeSupport,
+      compressionCodecName,
+      new CodecFactory(conf, encodingProps.getPageSizeThreshold()),
+      rowGroupSize,
+      validating,
+      conf,
+      maxPaddingSize,
+      encodingProps,
+      encryptionProperties);
+  }
+
+  ParquetWriter(
+    OutputFile file,

Review Comment:
   It seems the indentation of constructor is 4 spaces elsewhere.



##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java:
##########
@@ -321,17 +347,17 @@ public ParquetWriter(Path file, Configuration conf, 
WriteSupport<T> writeSupport
       encodingProps.getPageWriteChecksumEnabled(), encryptionProperties);
     fileWriter.start();
 
-    this.codecFactory = new CodecFactory(conf, 
encodingProps.getPageSizeThreshold());
+    this.codecFactory = codecFactory;
     CompressionCodecFactory.BytesInputCompressor compressor = 
codecFactory.getCompressor(compressionCodecName);
     this.writer = new InternalParquetRecordWriter<T>(
-        fileWriter,
-        writeSupport,
-        schema,
-        writeContext.getExtraMetaData(),
-        rowGroupSize,
-        compressor,
-        validating,
-        encodingProps);
+      fileWriter,

Review Comment:
   Could you please revert the irrelevant style change?





> Don't initialize CodecFactory in ParquetWriter
> ----------------------------------------------
>
>                 Key: PARQUET-2385
>                 URL: https://issues.apache.org/jira/browse/PARQUET-2385
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-mr
>            Reporter: Atour Mousavi Gourabi
>            Priority: Major
>
> In ParquetWriter we initialize a CodecFactory, instead we should allow users 
> to set their own via the builder as to provide a little more flexibility 
> (analogous to PARQUET-2282).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to