felipecrv commented on code in PR #35197:
URL: https://github.com/apache/arrow/pull/35197#discussion_r1175652162
##########
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:
I have a hard time inferring what comes out of this. An explicit type trait
struct with specializations would be more informative and produce cleaner error
messages for users.
--
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]