charlesdong1991 commented on code in PR #365:
URL: https://github.com/apache/fluss-rust/pull/365#discussion_r2849402838


##########
crates/fluss/src/row/column.rs:
##########
@@ -183,106 +200,138 @@ impl InternalRow for ColumnarRow {
         self.record_batch.num_columns()
     }
 
-    fn is_null_at(&self, pos: usize) -> bool {
-        self.record_batch.column(pos).is_null(self.row_id)
+    fn is_null_at(&self, pos: usize) -> Result<bool> {
+        if pos >= self.record_batch.num_columns() {
+            return Err(IllegalArgument {
+                message: format!(
+                    "position {pos} out of bounds (row has {} fields)",
+                    self.record_batch.num_columns()
+                ),
+            });
+        }
+        Ok(self.record_batch.column(pos).is_null(self.row_id))
     }
 
-    fn get_boolean(&self, pos: usize) -> bool {
-        self.record_batch
+    fn get_boolean(&self, pos: usize) -> Result<bool> {
+        Ok(self
+            .record_batch
             .column(pos)
-            .as_boolean()
-            .value(self.row_id)
+            .as_boolean_opt()

Review Comment:
   I think it's better we can have in separate PR, but IIUC, `column(pos)` will 
still panic if pos is OOB before hitting this line, we already did such check 
in `is_null_at`, maybe we can do the same in this one. Similarly to functions 
below. 
   Maybe can use a share helper function or something?
   



-- 
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]

Reply via email to