Defines aggregate function for testing different intermediate/output types that computes the truncated bigint sum of many floats.
| 249 | // Defines aggregate function for testing different intermediate/output types that |
| 250 | // computes the truncated bigint sum of many floats. |
| 251 | IMPALA_UDF_EXPORT |
| 252 | void 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 | |
| 263 | IMPALA_UDF_EXPORT |
| 264 | void TruncSumUpdate(FunctionContext* context, const DoubleVal& val, DoubleVal* total) { |
nothing calls this directly
no test coverage detected