peter-toth commented on code in PR #3597:
URL: https://github.com/apache/parquet-java/pull/3597#discussion_r3498798468
##########
parquet-column/src/main/java/org/apache/parquet/internal/filter2/columnindex/RowRanges.java:
##########
@@ -316,4 +316,72 @@ public List<Range> getRanges() {
public String toString() {
return ranges.toString();
}
+
+ /**
+ * @return a new {@link Builder} for constructing a {@link RowRanges} from a
sequence of
+ * selected row indices.
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Constructs a {@link RowRanges} by appending selected row indices in
strictly increasing
+ * order. Consecutive indices are coalesced into a single {@link Range};
gaps close the
+ * current run and start a new one.
+ *
+ * <p>Usage:
+ * <pre>{@code
+ * RowRanges.Builder builder = RowRanges.builder();
+ * for (long row : selectedRowsInOrder) {
+ * builder.addSelected(row);
+ * }
+ * RowRanges ranges = builder.build();
+ * }</pre>
+ */
+ public static class Builder {
Review Comment:
Good idea, fixed in
https://github.com/apache/parquet-java/pull/3597/commits/17cce6912afcc3836d96f703fae0462b67b5dff2.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]