emkornfield commented on code in PR #39677:
URL: https://github.com/apache/arrow/pull/39677#discussion_r1460653884


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -323,6 +323,19 @@ class SerializedPageWriter : public PageWriter {
 
     PARQUET_THROW_NOT_OK(sink_->Write(output_data_buffer, output_data_len));
 
+    // Add the dictionary page to the offsets
+    if (offset_index_builder_ != nullptr) {
+      const int64_t compressed_size = output_data_len + header_size;
+      if (compressed_size > std::numeric_limits<int32_t>::max()) {
+        throw ParquetException("Compressed dictionary page size overflows to 
INT32_MAX.");
+      }
+
+      /// start_pos is a relative offset in the buffered mode. It should be
+      /// adjusted via OffsetIndexBuilder::Finish() after BufferedPageWriter
+      /// has flushed all data pages.
+      offset_index_builder_->AddPage(start_pos, 
static_cast<int32_t>(compressed_size), -1);
+    }

Review Comment:
   I think we are in agreement on "a dictionary page is a type of page".   The 
original statement I was responding to was:
   
   > The dictionary page, is in fact, a type of data page.
   
   Which as highlighted above data pages have distinct enums and header 
metadata. It could be PageIndex was originally intended for all page types, in 
actual implementations and given existing metadata the index captures it is 
only for data pages.  Any changes to these semantics pose challenges for 
compatibility.



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