You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/26 22:20:44 UTC
[GitHub] [arrow-rs] tustvold opened a new pull request, #2942: Add page row count limit (#2941)
tustvold opened a new pull request, #2942:
URL: https://github.com/apache/arrow-rs/pull/2942
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #2941
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking change` label.
-->
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] alamb commented on a diff in pull request #2942: Add optional page row count limit for parquet `WriterProperties` (#2941)
Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2942:
URL: https://github.com/apache/arrow-rs/pull/2942#discussion_r1014088610
##########
parquet/src/column/writer/mod.rs:
##########
@@ -569,11 +569,13 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> {
//
// In such a scenario the dictionary decoder may return an estimated encoded
// size in excess of the page size limit, even when there are no buffered values
- if self.encoder.num_values() == 0 {
+ if self.page_metrics.num_buffered_values == 0 {
Review Comment:
I am not quite sure what bug you are referring to
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] ursabot commented on pull request #2942: Add optional page row count limit for parquet `WriterProperties` (#2941)
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #2942:
URL: https://github.com/apache/arrow-rs/pull/2942#issuecomment-1293984123
Benchmark runs are scheduled for baseline = 66ea66bde115a3479efa879eaf8b437d8a11bfc2 and contender = 880c4d98e6d570db701fb013f3abf5e5e6f42e32. 880c4d98e6d570db701fb013f3abf5e5e6f42e32 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/97e45a637cd441d8a2eb51b9a6a61b5e...491503e5d9cb4cc1a24e3b3b8104a433/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/0c00bd5d353d4f4183f8a481f95ad916...1e562f125b464b1e8bc3a7d2d5ec5eb0/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/b45af7356d1b45acacdbc39f2e72e2f9...86ee3ea25536444fbf1a4623e49ac497/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/6143cc1187a54936b84945f264d8d154...8a8b5c483cc54d0496daaf49a05bc0c1/)
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
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] alamb commented on a diff in pull request #2942: Add optional page row count limit for parquet `WriterProperties` (#2941)
Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2942:
URL: https://github.com/apache/arrow-rs/pull/2942#discussion_r1007159436
##########
parquet/src/file/properties.rs:
##########
@@ -271,19 +289,38 @@ impl WriterPropertiesBuilder {
self
}
- /// Sets data page size limit.
+ /// Sets data page size limit
Review Comment:
```suggestion
/// Sets best effort maximum size of a data page in bytes
```
##########
parquet/src/file/properties.rs:
##########
@@ -271,19 +289,38 @@ impl WriterPropertiesBuilder {
self
}
- /// Sets data page size limit.
+ /// Sets data page size limit
+ ///
+ /// Note: this is a best effort limit based on the write batch size
pub fn set_data_pagesize_limit(mut self, value: usize) -> Self {
self.data_pagesize_limit = value;
self
}
- /// Sets dictionary page size limit.
+ /// Sets data page row count limit
+ ///
+ ///
+ /// This can be used to limit the number of rows within a page to
+ /// yield better page pruning
+ ///
+ /// Note: this is a best effort limit based on the write batch size
+ pub fn set_data_page_row_count_limit(mut self, value: usize) -> Self {
+ self.data_page_row_count_limit = value;
+ self
+ }
+
+ /// Sets dictionary page size limit
Review Comment:
```suggestion
/// Sets best effort maximum dictionary page size, in bytes
```
##########
parquet/tests/arrow_writer_layout.rs:
##########
@@ -308,6 +308,34 @@ fn test_primitive() {
}],
},
});
+
+ // Test row count limit
+ let props = WriterProperties::builder()
+ .set_dictionary_enabled(false)
+ .set_data_page_row_count_limit(100)
+ .set_write_batch_size(100)
+ .build();
+
+ do_test(LayoutTest {
+ props,
+ batches: vec![batch],
+ layout: Layout {
+ row_groups: vec![RowGroup {
+ columns: vec![ColumnChunk {
+ pages: (0..20)
+ .map(|_| Page {
+ rows: 100,
Review Comment:
Not bad!
##########
parquet/src/file/properties.rs:
##########
@@ -271,19 +289,38 @@ impl WriterPropertiesBuilder {
self
}
- /// Sets data page size limit.
+ /// Sets data page size limit
+ ///
+ /// Note: this is a best effort limit based on the write batch size
pub fn set_data_pagesize_limit(mut self, value: usize) -> Self {
self.data_pagesize_limit = value;
self
}
- /// Sets dictionary page size limit.
+ /// Sets data page row count limit
Review Comment:
```suggestion
/// Sets best effort maximum number of rows in a data page
```
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] Ted-Jiang commented on a diff in pull request #2942: Add optional page row count limit for parquet `WriterProperties` (#2941)
Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on code in PR #2942:
URL: https://github.com/apache/arrow-rs/pull/2942#discussion_r1013838557
##########
parquet/src/column/writer/mod.rs:
##########
@@ -569,11 +569,13 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> {
//
// In such a scenario the dictionary decoder may return an estimated encoded
// size in excess of the page size limit, even when there are no buffered values
- if self.encoder.num_values() == 0 {
+ if self.page_metrics.num_buffered_values == 0 {
Review Comment:
I think this fix the `should_add_data_page` bug
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-rs] tustvold merged pull request #2942: Add optional page row count limit for parquet `WriterProperties` (#2941)
Posted by GitBox <gi...@apache.org>.
tustvold merged PR #2942:
URL: https://github.com/apache/arrow-rs/pull/2942
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org