MCPcopy Create free account
hub / github.com/apache/arrow / DropNullChunkedArray

Function DropNullChunkedArray

cpp/src/arrow/compute/kernels/vector_selection.cc:93–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93Result<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
111Result<Datum> DropNullRecordBatch(const std::shared_ptr<RecordBatch>& batch,
112 ExecContext* ctx) {

Callers 1

ExecuteImplMethod · 0.85

Calls 7

push_backMethod · 0.80
make_arrayMethod · 0.80
null_countMethod · 0.45
lengthMethod · 0.45
typeMethod · 0.45
memory_poolMethod · 0.45
chunksMethod · 0.45

Tested by

no test coverage detected