You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "choubacha (via GitHub)" <gi...@apache.org> on 2026/05/15 15:47:07 UTC

[PR] Adds is_null function to RowAccessor [arrow-rs]

choubacha opened a new pull request, #9979:
URL: https://github.com/apache/arrow-rs/pull/9979

   # Which issue does this PR close?
   
   - Closes #8076.
   
   # Rationale for this change
   
   When dealing with parquet files directly, having a built in option for checking for nulls is useful when reading the rows out of the file. This function allows gating calls to the other accessors so that they can be mapped to None instead of relying on errors or accessing the field vec itself.
   
   # Are these changes tested?
   
   Yes, a test was added.
   
   # Are there any user-facing changes?
   
   This does add to the Row api. The trait function has a documentation block.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "choubacha (via GitHub)" <gi...@apache.org>.
choubacha commented on code in PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979#discussion_r3282908104


##########
parquet/src/record/api.rs:
##########
@@ -244,15 +247,20 @@ macro_rules! row_complex_accessor {
 impl RowFormatter for Row {
     /// Get Display reference for a given field.
     fn fmt(&self, i: usize) -> &dyn fmt::Display {
-        &self.fields[i].1
+        if let Some((_, v)) = self.fields.get(i) {
+            v
+        } else {
+            &"<IndexOutOfBound>"

Review Comment:
   Unsure if this should be something different so if you have another recommendation feel free to weigh in.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "choubacha (via GitHub)" <gi...@apache.org>.
choubacha commented on PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979#issuecomment-4510418987

   Also noticing that these accessor functions appear to panic if you go out of bounds. I'd like to update those index operations with `get` so that they don't panic.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979#issuecomment-4521663915

   Thanks again @choubacha 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979#discussion_r3283475849


##########
parquet/src/record/api.rs:
##########
@@ -244,15 +247,20 @@ macro_rules! row_complex_accessor {
 impl RowFormatter for Row {
     /// Get Display reference for a given field.
     fn fmt(&self, i: usize) -> &dyn fmt::Display {
-        &self.fields[i].1
+        if let Some((_, v)) = self.fields.get(i) {
+            v
+        } else {
+            &"<IndexOutOfBound>"

Review Comment:
   seems fine to me



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "choubacha (via GitHub)" <gi...@apache.org>.
choubacha commented on PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979#issuecomment-4467049789

   Whoops, fixed the implementation and eliminated the Result as it's not actually needed.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds is_null function to RowAccessor [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9979:
URL: https://github.com/apache/arrow-rs/pull/9979


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org