You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "dinimar (via GitHub)" <gi...@apache.org> on 2023/03/19 12:56:00 UTC

[GitHub] [arrow] dinimar commented on a diff in pull request #34537: GH-14939: [C++] Support Table lookups in FieldRef and FieldPath

dinimar commented on code in PR #34537:
URL: https://github.com/apache/arrow/pull/34537#discussion_r1141354780


##########
cpp/src/arrow/type.cc:
##########
@@ -1159,6 +1161,20 @@ struct FieldPathGetImpl {
     });
   }
 
+  static Result<std::shared_ptr<ChunkedArray>> Get(const FieldPath* path,
+                                                   const ChunkedArrayVector& table) {
+    return FieldPathGetImpl::Get(
+      path, &table,
+      [](const std::shared_ptr<ChunkedArray>& data) -> const ChunkedArrayVector * {
+          auto chunkedArrayVector = data->Flatten();
+          if (!chunkedArrayVector.ok()) {
+            return nullptr;
+          }

Review Comment:
   If I understand right you want me to add logging for chunked arrays with bad status
   I've added following check:
   ```
   Result<std::shared_ptr<ChunkedArray>> FieldPath::Get(const Table& table) const {
     ARROW_ASSIGN_OR_RAISE(auto data, FieldPathGetImpl::Get(this, table.columns()));
     ARROW_CHECK_OK(data->ValidateFull());
     return data;
   ```
   



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