jecsand838 commented on code in PR #9171:
URL: https://github.com/apache/arrow-rs/pull/9171#discussion_r2724705824


##########
arrow-avro/src/writer/mod.rs:
##########
@@ -238,76 +247,40 @@ impl EncodedRows {
     /// encoder.encode(&batch)?;
     /// let rows = encoder.flush();
     ///
-    /// // Access the first row (index 0)
-    /// let row0 = rows.row(0)?;
-    /// assert!(!row0.is_empty());
+    /// assert_eq!(rows.iter().count(), 2);
     /// # Ok(())
     /// # }
     /// ```
-    pub fn row(&self, i: usize) -> Result<Bytes, ArrowError> {
-        if i >= self.len() {
+    pub fn row(&self, n: usize) -> Result<Bytes, ArrowError> {
+        if n >= self.len() {
             return Err(ArrowError::AvroError(format!(
-                "Row index {i} out of bounds for len {}",
+                "Row index {n} out of bounds for len {}",
                 self.len()
             )));
         }
         // SAFETY:
         // self.len() is defined as self.offsets.len().saturating_sub(1).
-        // The check `i >= self.len()` above ensures that `i < 
self.offsets.len() - 1`.
-        // Therefore, both `i` and `i + 1` are strictly within the bounds of 
`self.offsets`.
-        let (start_u64, end_u64) = unsafe {
+        // The check `n >= self.len()` above ensures that `n < 
self.offsets.len() - 1`.
+        // Therefore, both `n` and `n + 1` are strictly within the bounds of 
`self.offsets`.
+        let (start, end) = unsafe {

Review Comment:
   100%, that became apparent to me rather quickly lol.



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