You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sdd (via GitHub)" <gi...@apache.org> on 2024/08/25 18:01:44 UTC
[PR] feat(parquet): add union method to RowSelection [arrow-rs]
sdd opened a new pull request, #6308:
URL: https://github.com/apache/arrow-rs/pull/6308
Complements the existing `RowSelection::intersection` method. Useful for OR-ing row selections together, complementing
the use of `RowSelection::intersection` for AND-ing row selections
# Which issue does this PR close?
Closes https://github.com/apache/arrow-rs/issues/6307.
# Are there any user-facing changes?
Yes. Doc comments for `RowSelection::union` have been added accordingly as part of this PR.
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
--
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
Re: [PR] Parquet: add `union` method to `RowSelection` [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum commented on code in PR #6308:
URL: https://github.com/apache/arrow-rs/pull/6308#discussion_r1731194496
##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -343,6 +343,16 @@ impl RowSelection {
intersect_row_selections(&self.selectors, &other.selectors)
}
+ /// Compute the union of two [`RowSelection`]
+ /// For example:
+ /// self: NNYYYYNNYYNYN
+ /// other: NYNNNNNNN
+ ///
+ /// returned: NYYYYYNNYYNYN
+ pub fn union(&self, other: &Self) -> Self {
+ union_row_selections(&self.selectors, &other.selectors)
Review Comment:
why do we need an indirection here? as far as I can tell, the called method isn't used anywhere else.
--
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
Re: [PR] Parquet: add `union` method to `RowSelection` [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum commented on code in PR #6308:
URL: https://github.com/apache/arrow-rs/pull/6308#discussion_r1732445386
##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -343,6 +343,16 @@ impl RowSelection {
intersect_row_selections(&self.selectors, &other.selectors)
}
+ /// Compute the union of two [`RowSelection`]
+ /// For example:
+ /// self: NNYYYYNNYYNYN
+ /// other: NYNNNNNNN
+ ///
+ /// returned: NYYYYYNNYYNYN
+ pub fn union(&self, other: &Self) -> Self {
+ union_row_selections(&self.selectors, &other.selectors)
Review Comment:
Fair.
--
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
Re: [PR] Parquet: add `union` method to `RowSelection` [arrow-rs]
Posted by "sdd (via GitHub)" <gi...@apache.org>.
sdd commented on code in PR #6308:
URL: https://github.com/apache/arrow-rs/pull/6308#discussion_r1731244017
##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -343,6 +343,16 @@ impl RowSelection {
intersect_row_selections(&self.selectors, &other.selectors)
}
+ /// Compute the union of two [`RowSelection`]
+ /// For example:
+ /// self: NNYYYYNNYYNYN
+ /// other: NYNNNNNNN
+ ///
+ /// returned: NYYYYYNNYYNYN
+ pub fn union(&self, other: &Self) -> Self {
+ union_row_selections(&self.selectors, &other.selectors)
Review Comment:
I based it on the intersection method, which has this structure. I'm not familiar with this code base and the design decisions so I just went with what was there. I can refactor if required.
--
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
Re: [PR] Parquet: add `union` method to `RowSelection` [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum merged PR #6308:
URL: https://github.com/apache/arrow-rs/pull/6308
--
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