| 88 | namespace { |
| 89 | |
| 90 | ::arrow::Result<std::shared_ptr<ArrayData>> ChunksToSingle(const ChunkedArray& chunked) { |
| 91 | switch (chunked.num_chunks()) { |
| 92 | case 0: { |
| 93 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Array> array, |
| 94 | ::arrow::MakeArrayOfNull(chunked.type(), 0)); |
| 95 | return array->data(); |
| 96 | } |
| 97 | case 1: |
| 98 | return chunked.chunk(0)->data(); |
| 99 | default: |
| 100 | // ARROW-3762(wesm): If item reader yields a chunked array, we reject as |
| 101 | // this is not yet implemented |
| 102 | return Status::NotImplemented( |
| 103 | "Nested data conversions not implemented for chunked array outputs"); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | } // namespace |
| 108 |
no test coverage detected