JingsongLi commented on code in PR #207:
URL: https://github.com/apache/paimon-rust/pull/207#discussion_r3039668817
##########
crates/paimon/src/table/source.rs:
##########
@@ -22,6 +22,328 @@
use crate::spec::{BinaryRow, DataFileMeta};
use crate::table::stats_filter::group_by_overlapping_row_id;
use serde::{Deserialize, Serialize};
+// ======================= RowRange ===============================
+
+/// An inclusive row ID range `[from, to]` for filtering reads in data
evolution mode.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct RowRange {
+ from: i64,
+ to: i64,
+}
+
+impl RowRange {
+ pub fn new(from: i64, to: i64) -> Self {
+ debug_assert!(from <= to, "RowRange from ({from}) must be <= to
({to})");
+ Self { from, to }
+ }
+
+ pub fn from(&self) -> i64 {
+ self.from
+ }
+
+ pub fn to(&self) -> i64 {
+ self.to
+ }
+
+ pub fn count(&self) -> i64 {
+ self.to - self.from + 1
+ }
+
+ pub fn is_empty(&self) -> bool {
Review Comment:
It is useless. Already `debug_assert!(from <= 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]