This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-rust.git
The following commit(s) were added to refs/heads/main by this push:
new f10cb91d fix(table): reject row ranges for format tables at read
construction (#700)
f10cb91d is described below
commit f10cb91db9f413c4b9e9082505cd393f520518b7
Author: jackylee <[email protected]>
AuthorDate: Sat Aug 15 16:16:39 2026 +0800
fix(table): reject row ranges for format tables at read construction (#700)
---
crates/paimon/src/table/format_read_builder.rs | 7 +++++++
crates/paimon/src/table/read_builder.rs | 9 +++++++++
2 files changed, 16 insertions(+)
diff --git a/crates/paimon/src/table/format_read_builder.rs
b/crates/paimon/src/table/format_read_builder.rs
index 4360d041..a2b6f81f 100644
--- a/crates/paimon/src/table/format_read_builder.rs
+++ b/crates/paimon/src/table/format_read_builder.rs
@@ -127,6 +127,13 @@ impl<'a> FormatReadBuilder<'a> {
}
pub(crate) fn new_read(&self) -> Result<TableRead<'a>> {
+ // Fail closed here as well as in `FormatTableScan::plan`, so a caller
that
+ // goes straight to `new_read` cannot silently read unfiltered rows.
+ if self.row_ranges.is_some() {
+ return Err(crate::Error::Unsupported {
+ message: "Row ranges are not supported for format
tables".to_string(),
+ });
+ }
let core_options = self.table.schema().core_options();
core_options.ensure_read_authorized()?;
let read_type = match self.resolve_read_type()? {
diff --git a/crates/paimon/src/table/read_builder.rs
b/crates/paimon/src/table/read_builder.rs
index 4af47790..9b482d33 100644
--- a/crates/paimon/src/table/read_builder.rs
+++ b/crates/paimon/src/table/read_builder.rs
@@ -868,6 +868,15 @@ mod tests {
assert!(
matches!(error, crate::Error::Unsupported { ref message } if
message.contains("format tables"))
);
+
+ // `new_read` must reject too: a caller that skips planning would
otherwise
+ // read every row instead of the requested ranges.
+ let mut builder = table.new_read_builder();
+ builder.with_row_ranges(Vec::new());
+ let error = builder.new_read().unwrap_err();
+ assert!(
+ matches!(error, crate::Error::Unsupported { ref message } if
message.contains("format tables"))
+ );
}
fn dv_pk_table(table_path: &str, merge_engine: &str) -> Table {