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

Method ExecChunked

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

Source from the content-addressed store, hash-verified

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