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