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


##########
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:
   Ah, ok.  I very rarely work with chunked arrays and so you may be right.  It 
is possible to create chunks arrays with 0 chunks though:
   
   ```
   >>> pa.chunked_array([], pa.int8()).num_chunks
   0
   ```
   
   My comment was mostly for understanding.  I thought maybe a chunk was needed 
for some kind of inference.
   
   I think I would slightly prefer returning an empty chunked array (with 1 
chunk for consistency with `ChunkedArray::MakeEmpty`).



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