wangyum commented on a change in pull request #647:
URL: https://github.com/apache/parquet-mr/pull/647#discussion_r561914480



##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ColumnChunkPageWriteStore.java
##########
@@ -119,14 +127,28 @@ public void writePage(BytesInput bytes,
                 + compressedSize);
       }
       tempOutputStream.reset();
-      parquetMetadataConverter.writeDataPageV1Header(
+      if (pageWriteChecksumEnabled) {
+        crc.reset();
+        crc.update(compressedBytes.toByteArray());
+        parquetMetadataConverter.writeDataPageV1Header(
           (int)uncompressedSize,
           (int)compressedSize,
           valueCount,
           rlEncoding,
           dlEncoding,
           valuesEncoding,
+          (int) crc.getValue(),

Review comment:
       @gszadovszky Do we need to consider int overflow? For example:
   ```
   crc.getValue() = 4169965210
   (int) crc.getValue() = -125002086
   (int) (crc.getValue() & 0x7FFFFFFF) = 2022481562
   ```




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to