mapleFU commented on code in PR #47775:
URL: https://github.com/apache/arrow/pull/47775#discussion_r2425187236


##########
cpp/src/parquet/properties.h:
##########
@@ -1409,4 +1409,74 @@ struct ArrowWriteContext {
 PARQUET_EXPORT
 std::shared_ptr<ArrowWriterProperties> default_arrow_writer_properties();
 
+class PARQUET_EXPORT RewriterProperties {
+ public:
+  class Builder {
+   public:
+    Builder()
+        : pool_(::arrow::default_memory_pool()),
+          writer_properties_(default_writer_properties()),
+          reader_properties_(default_reader_properties()) {}
+
+    explicit Builder(const RewriterProperties& properties)
+        : pool_(properties.memory_pool()),
+          writer_properties_(properties.writer_properties()),
+          reader_properties_(properties.reader_properties()) {}
+
+    virtual ~Builder() = default;
+
+    /// Specify the memory pool for the rewriter. Default default_memory_pool.
+    Builder* memory_pool(MemoryPool* pool) {
+      pool_ = pool;
+      return this;
+    }
+
+    /// Set the writer properties.
+    Builder* writer_properties(std::shared_ptr<WriterProperties> properties) {
+      writer_properties_ = std::move(properties);
+      return this;
+    }
+
+    /// Set the reader properties.
+    Builder* reader_properties(ReaderProperties properties) {
+      reader_properties_ = std::move(properties);
+      return this;
+    }
+
+    /// Build the RewriterProperties with the builder parameters.
+    std::shared_ptr<RewriterProperties> build() {

Review Comment:
   const or move?



##########
cpp/src/parquet/page_index.cc:
##########
@@ -832,9 +864,14 @@ class PageIndexBuilderImpl final : public PageIndexBuilder 
{
     return encryptor;
   }
 
+  template <typename Builder>
+  using Index = std::conditional_t<std::is_same_v<Builder, ColumnIndexBuilder>,
+                                   format::ColumnIndex, format::OffsetIndex>;
+
   template <typename Builder>
   void SerializeIndex(
       const std::vector<std::vector<std::unique_ptr<Builder>>>& 
page_index_builders,
+      const std::vector<std::vector<std::unique_ptr<Index<Builder>>>>& 
page_indices,

Review Comment:
   Can this separate to different method? This reuse is a bit hacking to me



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