mapleFU commented on code in PR #8264:
URL: https://github.com/apache/arrow-rs/pull/8264#discussion_r2325346311


##########
parquet/src/file/writer.rs:
##########
@@ -966,7 +966,19 @@ impl<W: Write + Send> PageWriter for 
SerializedPageWriter<'_, W> {
         let mut spec = PageWriteSpec::new();
         spec.page_type = page_type;
         spec.uncompressed_size = page.uncompressed_size() + header_size;
+        if spec.uncompressed_size > i32::MAX as usize {

Review Comment:
   Or I can checking it when consuming, like in `to_thrift_header`
   
   ```rust
    pub(crate) fn to_thrift_header(&self) -> PageHeader {
           let uncompressed_size = self.uncompressed_size();
           let compressed_size = self.compressed_size();
           let num_values = self.num_values();
           let encoding = self.encoding();
           let page_type = self.page_type();
   
           let mut page_header = PageHeader {
               type_: page_type.into(),
               uncompressed_page_size: uncompressed_size as i32,
               compressed_page_size: compressed_size as i32,
               // TODO: Add support for crc checksum
               crc: None,
               data_page_header: None,
               index_page_header: None,
               dictionary_page_header: None,
               data_page_header_v2: None,
           };
   ```



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