| 297 | } |
| 298 | |
| 299 | IMPALA_UDF_EXPORT |
| 300 | BigIntVal 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(). |
nothing calls this directly
no test coverage detected