felipecrv commented on code in PR #35197:
URL: https://github.com/apache/arrow/pull/35197#discussion_r1175657421


##########
cpp/src/arrow/type.h:
##########
@@ -1698,10 +1698,41 @@ class ARROW_EXPORT FieldPath {
   /// \brief Retrieve the referenced child from a ChunkedArray
   Result<std::shared_ptr<ChunkedArray>> Get(const ChunkedArray& chunked_array) 
const;
 
+  /// \brief Retrieve the referenced child/column from an Array, ArrayData, 
ChunkedArray,
+  /// RecordBatch, or Table
+  ///
+  /// Unlike `FieldPath::Get`, these variants are not zero-copy and the 
retrieved child's
+  /// null bitmap is ANDed with its parent's
+  Result<std::shared_ptr<Array>> GetFlattened(const Array& array) const;
+  Result<std::shared_ptr<ArrayData>> GetFlattened(const ArrayData& data) const;
+  Result<std::shared_ptr<ChunkedArray>> GetFlattened(
+      const ChunkedArray& chunked_array) const;
+  Result<std::shared_ptr<Array>> GetFlattened(const RecordBatch& batch) const;
+  Result<std::shared_ptr<ChunkedArray>> GetFlattened(const Table& table) const;
+
  private:
   std::vector<int> indices_;
 };
 
+namespace internal {
+
+template <typename T>
+using FieldPathGetType =
+    decltype(std::declval<FieldPath>().Get(std::declval<T>()).ValueOrDie());

Review Comment:
   Only now I noticed you've just moved this code here.



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