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

Method PrepareEvalBatch

cpp/src/gandiva/annotator.cc:96–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96EvalBatchPtr Annotator::PrepareEvalBatch(const arrow::RecordBatch& record_batch,
97 const ArrayDataVector& out_vector) const {
98 EvalBatchPtr eval_batch = std::make_shared<EvalBatch>(
99 record_batch.num_rows(), buffer_count_, local_bitmap_count_);
100
101 // Fill in the entries for the input fields.
102 for (int i = 0; i < record_batch.num_columns(); ++i) {
103 const std::string& name = record_batch.column_name(i);
104 auto found = in_name_to_desc_.find(name);
105 if (found == in_name_to_desc_.end()) {
106 // skip columns not involved in the expression.
107 continue;
108 }
109
110 PrepareBuffersForField(*(found->second), *(record_batch.column_data(i)),
111 eval_batch.get(), false /*is_output*/);
112 }
113
114 // Fill in the entries for the output fields.
115 int idx = 0;
116 for (auto& arraydata : out_vector) {
117 const FieldDescriptorPtr& desc = out_descs_.at(idx);
118 PrepareBuffersForField(*desc, *arraydata, eval_batch.get(), true /*is_output*/);
119 ++idx;
120 }
121 return eval_batch;
122}
123
124} // namespace gandiva

Callers 2

ExecuteMethod · 0.80
TEST_FFunction · 0.80

Calls 6

column_dataMethod · 0.80
num_rowsMethod · 0.45
num_columnsMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.64