You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by GitBox <gi...@apache.org> on 2021/01/21 14:17:46 UTC

[GitHub] [parquet-mr] wangyum commented on a change in pull request #647: PARQUET-1580: Page-level CRC checksum verfication for DataPageV1

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:
users@infra.apache.org