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

Function TruncSumInit

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

Defines aggregate function for testing different intermediate/output types that computes the truncated bigint sum of many floats.

Source from the content-addressed store, hash-verified

249// Defines aggregate function for testing different intermediate/output types that
250// computes the truncated bigint sum of many floats.
251IMPALA_UDF_EXPORT
252void TruncSumInit(FunctionContext* context, DoubleVal* total) {
253 // Arg types should be logical input types of UDA.
254 assert(context->GetNumArgs() == 1);
255 assert(context->GetArgType(0)->type == FunctionContext::TYPE_DOUBLE);
256 assert(context->GetArgType(-1) == nullptr);
257 assert(context->GetArgType(1) == nullptr);
258 assert(context->GetIntermediateType().type == FunctionContext::TYPE_DOUBLE);
259 assert(context->GetReturnType().type == FunctionContext::TYPE_BIGINT);
260 *total = DoubleVal(0);
261}
262
263IMPALA_UDF_EXPORT
264void TruncSumUpdate(FunctionContext* context, const DoubleVal& val, DoubleVal* total) {

Callers

nothing calls this directly

Calls 3

DoubleValClass · 0.85
GetNumArgsMethod · 0.80
GetArgTypeMethod · 0.80

Tested by

no test coverage detected