MCPcopy Create free account
hub / github.com/apache/impala / Codegen

Method Codegen

be/src/exec/hdfs-columnar-scanner.cc:167–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167Status HdfsColumnarScanner::Codegen(HdfsScanPlanNode* node, FragmentState* state,
168 llvm::Function** process_scratch_batch_fn) {
169 DCHECK(state->ShouldCodegen());
170 *process_scratch_batch_fn = nullptr;
171 LlvmCodeGen* codegen = state->codegen();
172 DCHECK(codegen != nullptr);
173
174 llvm::Function* fn = codegen->GetFunction(IRFunction::PROCESS_SCRATCH_BATCH, true);
175 DCHECK(fn != nullptr);
176
177 llvm::Function* eval_conjuncts_fn;
178 const vector<ScalarExpr*>& conjuncts = node->conjuncts_;
179 RETURN_IF_ERROR(ExecNode::CodegenEvalConjuncts(codegen, conjuncts, &eval_conjuncts_fn));
180 DCHECK(eval_conjuncts_fn != nullptr);
181
182 int replaced = codegen->ReplaceCallSites(fn, eval_conjuncts_fn, "EvalConjuncts");
183 DCHECK_REPLACE_COUNT(replaced, 1);
184
185 llvm::Function* eval_runtime_filters_fn;
186 RETURN_IF_ERROR(CodegenEvalRuntimeFilters(
187 codegen, node->runtime_filter_exprs_, &eval_runtime_filters_fn));
188 DCHECK(eval_runtime_filters_fn != nullptr);
189
190 replaced = codegen->ReplaceCallSites(fn, eval_runtime_filters_fn, "EvalRuntimeFilters");
191 DCHECK_REPLACE_COUNT(replaced, 1);
192
193 fn->setName("ProcessScratchBatch");
194 *process_scratch_batch_fn = codegen->FinalizeFunction(fn);
195 if (*process_scratch_batch_fn == nullptr) {
196 return Status("Failed to finalize process_scratch_batch_fn.");
197 }
198 return Status::OK();
199}
200
201int HdfsColumnarScanner::ProcessScratchBatchCodegenOrInterpret(RowBatch* dst_batch) {
202 return CallCodegendOrInterpreted<ProcessScratchBatchFn>::invoke(this,

Callers

nothing calls this directly

Calls 7

OKFunction · 0.85
ReplaceCallSitesMethod · 0.80
FinalizeFunctionMethod · 0.80
StatusClass · 0.70
ShouldCodegenMethod · 0.45
codegenMethod · 0.45
GetFunctionMethod · 0.45

Tested by

no test coverage detected