Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARQUET-1629: Support CRC for data page v2 #1044

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Conversation

wgtmac
Copy link
Member

@wgtmac wgtmac commented Mar 23, 2023

Jira

https://issues.apache.org/jira/browse/PARQUET-1629

Tests

Refactored TestDataPageV1Checksums to support both V1 and V2 data pages in all cases.

Commits

  • Writer computes crc and writes it into data page v2 header if enabled.
  • Reader verifies crc from data page v2 header if enabled.

@wgtmac wgtmac changed the title PARQUET-1629: Support CRC for data page v2 PARQUET-1629: [WIP] Support CRC for data page v2 Mar 23, 2023
@shangxinli
Copy link
Contributor

Just curious, are there real use cases for page V2?

@wgtmac
Copy link
Member Author

wgtmac commented May 23, 2023

Just curious, are there real use cases for page V2?

IMO, it has some advantages such as turning on/off compression per page.

@wgtmac wgtmac changed the title PARQUET-1629: [WIP] Support CRC for data page v2 PARQUET-1629: Support CRC for data page v2 Jun 22, 2023
@wgtmac
Copy link
Member Author

wgtmac commented Jun 22, 2023

cc @mapleFU as you have implemented this in the parquet-cpp.

@wgtmac wgtmac requested a review from shangxinli July 13, 2023 09:02
@shangxinli
Copy link
Contributor

LGTM

final BytesInput definitionLevels = this.readAsBytesInput(dataHeaderV2.getDefinition_levels_byte_length());
final BytesInput values = this.readAsBytesInput(dataSize);
if (options.usePageChecksumVerification() && pageHeader.isSetCrc()) {
pageBytes = BytesInput.concat(repetitionLevels, definitionLevels, values);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this concat three parts and get crc? Can it accumulated crc and avoid concat these buffers?

@wgtmac wgtmac merged commit d2c3c6d into apache:master Jul 24, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants