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/10/06 07:54:23 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #14326: ARROW-14596: [C++][Python] Read table nested fields in columns

jorisvandenbossche commented on code in PR #14326:
URL: https://github.com/apache/arrow/pull/14326#discussion_r988670499


##########
cpp/src/arrow/compute/kernels/scalar_nested.cc:
##########
@@ -242,6 +245,20 @@ struct StructFieldFunctor {
                                 union_array.GetFlattenedField(index, ctx->memory_pool()));
           break;
         }
+        case Type::LIST: {
+          const auto& list_array = checked_cast<const ListArray&>(*current);
+          ARROW_LOG(INFO) << list_array.ToString();
+          ARROW_ASSIGN_OR_RAISE(
+              Datum indices,
+              CallFunction("add", {list_array.offsets()->Slice(
+                                       0, list_array.offsets()->length() - 1),
+                                   MakeScalar(index)}));
+          ARROW_ASSIGN_OR_RAISE(Datum result, CallFunction("take", {list_array.values(),

Review Comment:
   What this is doing is probably the `list_element` kernel ? (defined just above)



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