HuaHuaY commented on code in PR #51685:
URL: https://github.com/apache/arrow/pull/51685#discussion_r4244573869


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -775,11 +777,11 @@ class ColumnWriterImpl {
       compressor_temp_buffer_ =
           std::static_pointer_cast<ResizableBuffer>(AllocateBuffer(allocator_, 
0));
     }
-    if (properties_->content_defined_chunking_enabled()) {
-      auto cdc_options = properties_->content_defined_chunking_options();
-      content_defined_chunker_.emplace(level_info_, cdc_options.min_chunk_size,
-                                       cdc_options.max_chunk_size,
-                                       cdc_options.norm_level);
+    if (properties_->content_defined_chunking_enabled() &&

Review Comment:
   Could we remove `properties_->content_defined_chunking_enabled()` from 
`column_writer.cc` and simply use `content_defined_chunker_ == nullptr` to 
determine whether CDC is enabled? If we restrict the check for 
`properties_->content_defined_chunking_enabled()` to `file_writer.cc`, we can 
avoid dealing with the four possible combinations (2x2) within 
`column_writer.cc`.



##########
cpp/src/parquet/column_writer.h:
##########
@@ -127,10 +131,10 @@ class PARQUET_EXPORT ColumnWriter {
  public:
   virtual ~ColumnWriter() = default;
 
-  static std::shared_ptr<ColumnWriter> Make(ColumnChunkMetaDataBuilder*,
-                                            std::unique_ptr<PageWriter>,
-                                            const WriterProperties* properties,
-                                            BloomFilter* bloom_filter = 
NULLPTR);
+  static std::shared_ptr<ColumnWriter> Make(
+      ColumnChunkMetaDataBuilder*, std::unique_ptr<PageWriter>,
+      const WriterProperties* properties, BloomFilter* bloom_filter = NULLPTR,
+      internal::ContentDefinedChunker* content_defined_chunker = NULLPTR);

Review Comment:
   Is it permissible to expose internal class via a public interface and should 
`internal::ContentDefinedChunker` be moved out of the `internal` namespace?



-- 
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]

Reply via email to