You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/23 18:15:56 UTC

[GitHub] [arrow-rs] alamb commented on a change in pull request #1465: Support the `length` kernel on Binary Array

alamb commented on a change in pull request #1465:
URL: https://github.com/apache/arrow-rs/pull/1465#discussion_r833584111



##########
File path: arrow/src/compute/kernels/length.rs
##########
@@ -15,59 +15,62 @@
 // specific language governing permissions and limitations
 // under the License.
 
-//! Defines kernel for length of a string array
+//! Defines kernel for length of string arrays and binary arrays
 
-use crate::{
-    array::*,
-    buffer::Buffer,
-    datatypes::{ArrowNativeType, ArrowPrimitiveType},
-};
+use crate::{array::*, buffer::Buffer, datatypes::ArrowPrimitiveType};
 use crate::{
     datatypes::{DataType, Int32Type, Int64Type},
     error::{ArrowError, Result},
 };
 
-fn unary_offsets_string<O, F>(
-    array: &GenericStringArray<O>,
-    data_type: DataType,
-    op: F,
+macro_rules! unary_offsets {
+    ($array: expr, $data_type: expr, $op: expr) => {{
+        // note: offsets are stored as u8, but they can be interpreted as OffsetSize

Review comment:
       I know this comment was just copy/pasted but I don't think it is accurate -- the offsets are i32 or i64 




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