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


##########
cpp/src/arrow/type.cc:
##########
@@ -1216,6 +1321,18 @@ Result<std::shared_ptr<ArrayData>> FieldPath::Get(const 
ArrayData& data) const {
   return FieldPathGetImpl::Get(this, data.child_data);
 }
 
+Result<std::shared_ptr<ChunkedArray>> FieldPath::Get(
+    const ChunkedArray& chunked_array) const {
+  if (chunked_array.num_chunks() < 1) {
+    return Status::Invalid("Chunked array must have at least one chunk");

Review Comment:
   I was under the impression that it would be considered invalid since 
`ChunkedArray::MakeEmpty` always allocates one chunk. 
https://github.com/dinimar/arrow/blob/ec6caeff8477af08679de7a7f12b90d4ba302457/cpp/src/arrow/chunked_array.h#L95-L96
   
   Whether that's reasonable or not, I'm open to just returning an empty 
`ChunkedArray` here (based on its `type` or `storage_type`) if that makes more 
sense.



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