This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
The following commit(s) were added to refs/heads/main by this push:
new c644023 chore: fix GenericRow null detection (#86)
c644023 is described below
commit c644023c7e8719bed7d753a36f2b054c1838be31
Author: Chase Naples <[email protected]>
AuthorDate: Thu Dec 11 20:34:59 2025 -0500
chore: fix GenericRow null detection (#86)
---
crates/fluss/src/row/mod.rs | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/crates/fluss/src/row/mod.rs b/crates/fluss/src/row/mod.rs
index a3b8885..909f3b1 100644
--- a/crates/fluss/src/row/mod.rs
+++ b/crates/fluss/src/row/mod.rs
@@ -81,8 +81,11 @@ impl<'a> InternalRow for GenericRow<'a> {
self.values.len()
}
- fn is_null_at(&self, _pos: usize) -> bool {
- false
+ fn is_null_at(&self, pos: usize) -> bool {
+ self.values
+ .get(pos)
+ .expect("position out of bounds")
+ .is_null()
}
fn get_boolean(&self, pos: usize) -> bool {
@@ -153,3 +156,18 @@ impl<'a> GenericRow<'a> {
self.values.insert(pos, value.into());
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn is_null_at_checks_datum_nullity() {
+ let mut row = GenericRow::new();
+ row.set_field(0, Datum::Null);
+ row.set_field(1, 42_i32);
+
+ assert!(row.is_null_at(0));
+ assert!(!row.is_null_at(1));
+ }
+}