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

Method Init

cpp/src/arrow/compute/exec.cc:344–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342} // namespace
343
344Status ExecSpanIterator::Init(const ExecBatch& batch, int64_t max_chunksize,
345 bool promote_if_all_scalars) {
346 if (batch.num_values() > 0) {
347 // Validate arguments
348 bool all_args_same_length = false;
349 int64_t inferred_length = InferBatchLength(batch.values, &all_args_same_length);
350 if (inferred_length != batch.length) {
351 return Status::Invalid("Value lengths differed from ExecBatch length");
352 }
353 if (!all_args_same_length) {
354 return Status::Invalid("Array arguments must all be the same length");
355 }
356 }
357 args_ = &batch.values;
358 initialized_ = have_chunked_arrays_ = false;
359 have_all_scalars_ = CheckIfAllScalar(batch);
360 promote_if_all_scalars_ = promote_if_all_scalars;
361 position_ = 0;
362 length_ = batch.length;
363 chunk_indexes_.clear();
364 chunk_indexes_.resize(args_->size(), 0);
365 value_positions_.clear();
366 value_positions_.resize(args_->size(), 0);
367 value_offsets_.clear();
368 value_offsets_.resize(args_->size(), 0);
369 max_chunksize_ = std::min(length_, max_chunksize);
370 return Status::OK();
371}
372
373int64_t ExecSpanIterator::GetNextChunkSpan(int64_t iteration_size, ExecSpan* span) {
374 for (size_t i = 0; i < args_->size() && iteration_size > 0; ++i) {

Callers 13

ExecuteScalarExpressionFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
SetupIteratorMethod · 0.45
TEST_FFunction · 0.45
CallMethod · 0.45
TEST_FFunction · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
GetFunctionExecutorFunction · 0.45
BM_AddDispatchFunction · 0.45

Calls 8

InferBatchLengthFunction · 0.85
CheckIfAllScalarFunction · 0.85
resizeMethod · 0.80
InvalidFunction · 0.50
OKFunction · 0.50
num_valuesMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45

Tested by 7

TESTFunction · 0.36
TESTFunction · 0.36
SetupIteratorMethod · 0.36
TEST_FFunction · 0.36
CallMethod · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36