Skip to content

Commit

Permalink
Update code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed May 10, 2024
1 parent 76d1d78 commit ec5bc9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arrow-array/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ impl<'a> ImportedArrowArray<'a> {
(length + 1) * (bits / 8)
}
(DataType::Utf8, 2) | (DataType::Binary, 2) => {
// the len of the data buffer (buffer 2) equals the last value of the offset buffer (buffer 1)
// the len of the data buffer (buffer 2) equals the difference between the last value
// and the first value of the offset buffer (buffer 1).
let len = self.buffer_len(1, dt)?;
// first buffer is the null buffer => add(1)
// we assume that pointer is aligned for `i32`, as Utf8 uses `i32` offsets.
Expand All @@ -438,7 +439,8 @@ impl<'a> ImportedArrowArray<'a> {
end - start
}
(DataType::LargeUtf8, 2) | (DataType::LargeBinary, 2) => {
// the len of the data buffer (buffer 2) equals the last value of the offset buffer (buffer 1)
// the len of the data buffer (buffer 2) equals the difference between the last value
// and the first value of the offset buffer (buffer 1).
let len = self.buffer_len(1, dt)?;
// first buffer is the null buffer => add(1)
// we assume that pointer is aligned for `i64`, as Large uses `i64` offsets.
Expand Down

0 comments on commit ec5bc9a

Please sign in to comment.