edponce commented on a change in pull request #11127:
URL: https://github.com/apache/arrow/pull/11127#discussion_r705858924



##########
File path: cpp/src/arrow/compute/kernels/scalar_nested.cc
##########
@@ -55,6 +55,23 @@ Status ListValueLength(KernelContext* ctx, const ExecBatch& 
batch, Datum* out) {
   return Status::OK();
 }
 
+Status FixedSizeListValueLength(KernelContext* ctx, const ExecBatch& batch, 
Datum* out) {
+  auto width = checked_cast<const 
FixedSizeListType&>(*batch[0].type()).list_size();
+  if (batch[0].kind() == Datum::ARRAY) {
+    const auto& arr = *batch[0].array();
+    ArrayData* out_arr = out->mutable_array();
+    int32_t* out_values = out_arr->GetMutableValues<int32_t>(1);
+    std::fill(out_values, out_values + arr.length, width);

Review comment:
       Why not use `FixedSizeListType::offset_type` instead of explicit 
`int32_t`?




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