Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix reading Parquet string cols when
nrows
andinput_pass_limit
> 0 #17321Fix reading Parquet string cols when
nrows
andinput_pass_limit
> 0 #17321Changes from 4 commits
902019d
3e9f837
238e7ae
f739e3e
7c8871b
5ef5966
9d0be1e
f5b16ed
c984528
241a88f
7c33c85
764035d
6859299
801c08e
752241c
54270f6
469c664
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cudf/cpp/src/io/parquet/reader_impl_preprocess.cu
Lines 1373 to 1376 in 9da8eb2
^Here we adjust the
num_rows
for the last page wheninput_pass_limit > 0
to compensate for lists. This leads to a false negativeis_bounds_page
for the last page of str cols due to thepage_end > end
predicate. This false negative results inpage_bounds()
including total size of last page instead of clipping it atnrows
. This finally manifests in theout_buf.create_string_data()
with largernum_bytes
than data size leading to the extra\x00
chars in the column.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nvdbaranec I didn't see the effect of adjusting
num_rows
for the last page showing up for other col types andis_bounds_page
is only used in string decoders so I am hoping other decoders don't rely on a similar predicate (at least doesn't seem like in the tests).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know it's a convoluted bug when the fix is 99% comment.
Should we try to keep the condition and change the
num_rows
adjustment? This fix feels like a workaround for incorrectnum_rows
(expecting to be wrong on this one, but want to make sure we at least consider this).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ikr, I have been debating myself with this one as well. I am not fully sure if we would break things by adjusting
num_rows
for the last pages of cols (to what?) ingenerate_list_column_row_count_estimates()
and keep the original condition here. Maybe @nvdbaranec or @etseidl can comment here better.For now, I chose to relax this condition as this function (
is_bounds_page()
) is only being used in string decoders (narrower scope) and the described problem is only being seen in string cols.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me nervous. So in the normal case, won't this mean every final page is a bounds page, regardless of whether we're using
num_rows
? That means unnecessary processing when all we want to do is read the entire page anyway. Could we add a boolean argument tois_bounds_page
ifnum_rows
has been modified, or add a field to thePageInfo
struct? Or maybe do as @vuule suggests (change thenum_rows
adjustment)...perhaps add anadjusted_num_rows
🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, Ed! I have added a new boolean field to
PageInfo
which tells if thenum_rows
for this page has been adjusted and if so, we relax the condition.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar test as above (
test_parquet_chunked_reader
) but with astruct
table.