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

Function TruncSumFinalize

be/src/testutil/test-udas.cc:299–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299IMPALA_UDF_EXPORT
300BigIntVal TruncSumFinalize(FunctionContext* context, const DoubleVal& total) {
301 // Arg types should be logical input types of UDA.
302 assert(context->GetNumArgs() == 1);
303 assert(context->GetArgType(0)->type == FunctionContext::TYPE_DOUBLE);
304 assert(context->GetArgType(-1) == nullptr);
305 assert(context->GetArgType(1) == nullptr);
306 assert(context->GetIntermediateType().type == FunctionContext::TYPE_DOUBLE);
307 assert(context->GetReturnType().type == FunctionContext::TYPE_BIGINT);
308 return BigIntVal(static_cast<int64_t>(total.val));
309}
310
311// Defines aggregate function for testing constant argument handling. The UDA returns
312// true if its second argument is constant for all calls to Update().

Callers

nothing calls this directly

Calls 3

BigIntValClass · 0.85
GetNumArgsMethod · 0.80
GetArgTypeMethod · 0.80

Tested by

no test coverage detected