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

Method CodegenUpdateOrMergeFunction

be/src/exprs/agg-fn.cc:152–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152Status AggFn::CodegenUpdateOrMergeFunction(
153 LlvmCodeGen* codegen, llvm::Function** uda_fn) {
154 const string& symbol =
155 is_merge_ ? fn_.aggregate_fn.merge_fn_symbol : fn_.aggregate_fn.update_fn_symbol;
156 vector<ColumnType> fn_arg_types;
157 for (ScalarExpr* input_expr : children()) {
158 fn_arg_types.push_back(input_expr->type());
159 }
160 // The intermediate value is passed as the last argument.
161 fn_arg_types.push_back(intermediate_type());
162 RETURN_IF_ERROR(codegen->LoadFunction(fn_, symbol, nullptr, fn_arg_types,
163 fn_arg_types.size(), false, uda_fn, &cache_entry_));
164
165 // Inline constants into the function body (if there is an IR body).
166 if (!(*uda_fn)->isDeclaration()) {
167 // TODO: IMPALA-4785: we should also replace references to GetIntermediateType()
168 // with constants.
169 codegen->InlineConstFnAttrs(GetOutputTypeDesc(), arg_type_descs_, *uda_fn);
170 *uda_fn = codegen->FinalizeFunction(*uda_fn);
171 if (*uda_fn == nullptr) {
172 return Status(TErrorCode::UDF_VERIFY_FAILED, symbol, fn_.hdfs_location);
173 }
174 }
175 return Status::OK();
176}
177
178void AggFn::Close() {
179 // This also closes all the input expressions.

Callers 1

CodegenCallUdaMethod · 0.80

Calls 8

OKFunction · 0.85
push_backMethod · 0.80
LoadFunctionMethod · 0.80
FinalizeFunctionMethod · 0.80
StatusClass · 0.70
typeMethod · 0.45
sizeMethod · 0.45
InlineConstFnAttrsMethod · 0.45

Tested by

no test coverage detected