| 91 | } |
| 92 | |
| 93 | Result<Datum> DropNullChunkedArray(const std::shared_ptr<ChunkedArray>& values, |
| 94 | ExecContext* ctx) { |
| 95 | if (values->null_count() == 0) { |
| 96 | return values; |
| 97 | } |
| 98 | if (values->null_count() == values->length()) { |
| 99 | return ChunkedArray::MakeEmpty(values->type(), ctx->memory_pool()); |
| 100 | } |
| 101 | std::vector<std::shared_ptr<Array>> new_chunks; |
| 102 | for (const auto& chunk : values->chunks()) { |
| 103 | ARROW_ASSIGN_OR_RAISE(auto new_chunk, DropNullArray(chunk, ctx)); |
| 104 | if (new_chunk.length() > 0) { |
| 105 | new_chunks.push_back(new_chunk.make_array()); |
| 106 | } |
| 107 | } |
| 108 | return std::make_shared<ChunkedArray>(std::move(new_chunks)); |
| 109 | } |
| 110 | |
| 111 | Result<Datum> DropNullRecordBatch(const std::shared_ptr<RecordBatch>& batch, |
| 112 | ExecContext* ctx) { |
no test coverage detected