emkornfield commented on code in PR #3396:
URL: https://github.com/apache/parquet-java/pull/3396#discussion_r2836932714


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ColumnChunkPageWriteStore.java:
##########
@@ -672,6 +673,83 @@ public ColumnChunkPageWriteStore(
     }
   }
 
+  /**
+   * Construct a page write store with per-column compression support.
+   * Each column's compression codec is resolved from {@code props} via
+   * {@link ParquetProperties#getCompressionCodec(ColumnDescriptor)}.
+   *
+   * @param codecFactory           factory to create compressors for each codec
+   * @param props                  properties containing per-column 
compression configuration
+   * @param schema                 the message schema
+   * @param allocator              byte buffer allocator
+   * @param columnIndexTruncateLength truncate length for column indexes
+   * @param pageWriteChecksumEnabled  whether to write page checksums
+   * @param fileEncryptor          file encryptor (null if not encrypted)
+   * @param rowGroupOrdinal        row group ordinal
+   */
+  public ColumnChunkPageWriteStore(
+      CompressionCodecFactory codecFactory,
+      ParquetProperties props,
+      MessageType schema,
+      ByteBufferAllocator allocator,
+      int columnIndexTruncateLength,
+      boolean pageWriteChecksumEnabled,
+      InternalFileEncryptor fileEncryptor,
+      int rowGroupOrdinal) {
+    this.schema = schema;
+    if (null == fileEncryptor) {
+      for (ColumnDescriptor path : schema.getColumns()) {
+        BytesInputCompressor compressor = 
codecFactory.getCompressor(props.getCompressionCodec(path));
+        writers.put(
+            path,
+            new ColumnChunkPageWriter(

Review Comment:
   Is this copy and paste from other constructors, I wonder if there is some 
refactoring that can be done to avoid duplication? (I wonder if we should have 
a ColumnChunkPageWriterBuilder?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to