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

Cleanup record skipping logic and tests (#2158) #2199

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Follows on from #2158
Part of #2198

Rationale for this change

Some miscellaneous cleanups to make the tests slightly easier to follow, and to allow for future test integration.

What changes are included in this PR?

Are there any user-facing changes?

No

let test_file = File::open(&path).unwrap();
/// Given a RecordBatch containing all the column data, return the expected batches given
/// a `batch_size` and `selection`
fn get_expected_batches(
Copy link
Contributor Author

@tustvold tustvold Jul 27, 2022

Choose a reason for hiding this comment

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

I extracted this logic into a function so that it can be used as part of #2198

This may need to change depending on #2197

fn set_column_reader<V, CV>(
/// Returns the number of records skipped, which can be less than `batch_size` if
/// pages is exhausted
fn skip_records<V, CV>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found this method somewhat confusing, and I think it could potentially get stuck if the column reader was set but exhausted (i.e. on a column chunk boundary). #2198 will add some test coverage of this case, and this just copies the logic from read_records above, which is correct.

Copy link
Contributor Author

@tustvold tustvold Jul 27, 2022

Choose a reason for hiding this comment

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

Confirmed this to be a bug fixed by this PR in #2201

@github-actions github-actions bot added the parquet Changes to the parquet crate label Jul 27, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #2199 (2423211) into master (e096ec7) will decrease coverage by 0.01%.
The diff coverage is 92.59%.

@@            Coverage Diff             @@
##           master    #2199      +/-   ##
==========================================
- Coverage   82.60%   82.58%   -0.02%     
==========================================
  Files         239      239              
  Lines       62255    62188      -67     
==========================================
- Hits        51428    51361      -67     
  Misses      10827    10827              
Impacted Files Coverage Δ
...et/src/arrow/array_reader/byte_array_dictionary.rs 86.97% <0.00%> (+0.30%) ⬆️
parquet/src/arrow/array_reader/null_array.rs 81.48% <0.00%> (+2.91%) ⬆️
parquet/src/arrow/arrow_reader.rs 95.11% <95.00%> (-0.61%) ⬇️
parquet/src/arrow/array_reader/byte_array.rs 86.32% <100.00%> (-0.04%) ⬇️
parquet/src/arrow/array_reader/mod.rs 92.59% <100.00%> (+5.09%) ⬆️
parquet/src/arrow/array_reader/primitive_array.rs 90.17% <100.00%> (-0.06%) ⬇️
...row/src/array/builder/string_dictionary_builder.rs 90.64% <0.00%> (-0.72%) ⬇️
arrow/src/datatypes/datatype.rs 62.69% <0.00%> (-0.32%) ⬇️
parquet/src/arrow/record_reader/mod.rs 93.92% <0.00%> (-0.31%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

@Ted-Jiang can you please review this PR?

cc @thinkharderdev

);
total_row_count += batch_size;
} else if num == selection_len {
let do_test = |batch_size: usize, selection_len: usize| {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@Ted-Jiang Ted-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the cleanup 😊

@tustvold tustvold merged commit cc96687 into apache:master Jul 28, 2022
@ursabot
Copy link

ursabot commented Jul 28, 2022

Benchmark runs are scheduled for baseline = 9e47779 and contender = cc96687. cc96687 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants