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

Method ExecChunked

cpp/src/arrow/compute/kernels/vector_statistics.cc:80–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 static Status ExecChunked(KernelContext* ctx, const ExecBatch& batch, Datum* out) {
81 const auto& options = WinsorizeState::Get(ctx);
82 RETURN_NOT_OK(ValidateOptions(options));
83 const auto& chunked_array = batch.values[0].chunked_array();
84 ARROW_ASSIGN_OR_RAISE(auto maybe_quantiles,
85 GetQuantileValues(ctx, chunked_array, options));
86 if (!maybe_quantiles.has_value()) {
87 // Only nulls and NaNs => return input as-is
88 *out = chunked_array;
89 return Status::OK();
90 }
91 ArrayVector out_chunks;
92 out_chunks.reserve(chunked_array->num_chunks());
93 for (const auto& chunk : chunked_array->chunks()) {
94 auto out_data = chunk->data()->Copy();
95 RETURN_NOT_OK(
96 ClipValues(*chunk->data(), maybe_quantiles.value(), out_data.get(), ctx));
97 out_chunks.push_back(MakeArray(out_data));
98 }
99 return ChunkedArray::Make(std::move(out_chunks)).Value(out);
100 }
101
102 struct QuantileValues {
103 CType lower_bound, upper_bound;

Callers

nothing calls this directly

Calls 15

ClipValuesFunction · 0.85
chunked_arrayMethod · 0.80
push_backMethod · 0.80
ValidateOptionsFunction · 0.70
MakeArrayFunction · 0.70
GetFunction · 0.50
OKFunction · 0.50
MakeFunction · 0.50
reserveMethod · 0.45
num_chunksMethod · 0.45
chunksMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected