Skip to content

PARQUET-2008: [C++] Fix information written in RowGroup::total_byte_size - #9791

Closed
pitrou wants to merge 1 commit into
apache:masterfrom
pitrou:PARQUET-2008-total-byte-size
Closed

pitrou wants to merge 1 commit into
apache:masterfrom
pitrou:PARQUET-2008-total-byte-size

Conversation

@pitrou

@pitrou pitrou commented Mar 24, 2021

Copy link
Copy Markdown
Member

We need to write out the uncompressed size (including headers), not the compressed size.

This matches parquet-mr's behaviour.

We need to write out the uncompressed size (including headers), not the compressed size.

This matches parquet-mr's behaviour.
@pitrou
pitrou force-pushed the PARQUET-2008-total-byte-size branch from d714c0a to d46927f Compare March 24, 2021 15:28
@pitrou
pitrou requested a review from emkornfield March 24, 2021 15:30
@github-actions

Copy link
Copy Markdown

if (expected_codec_type == Compression::UNCOMPRESSED) {
ASSERT_EQ(total_byte_size, total_compressed_size);
} else {
ASSERT_NE(total_byte_size, total_compressed_size);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, i guess this is technically correct, as there some cases that compression might enlarge buffers but maybe ASSERT_GE?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Well, with small buffers you may indeed get a size growth (some of the files in parquet-testing actually exhibit that).

@emkornfield

Copy link
Copy Markdown
Contributor

Overall, looks OK to me. Does this have practical implications for reading back data? Did you find this with a code audit?

@pitrou

pitrou commented Mar 25, 2021

Copy link
Copy Markdown
Member Author

Does this have practical implications for reading back data?

It doesn't seem to, otherwise we would have had bug reports?

Did you find this with a code audit?

No, just by running parquet-reader on various files on the parquet-testing repo, I noticed that the byte sizes seemed off in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants