Defines AggDecimalIntermediate(DECIMAL(1,2), INT) returns DECIMAL(5,6) intermediate DECIMAL(3,4) Useful to test that type parameters are plumbed through.
| 106 | // intermediate DECIMAL(3,4) |
| 107 | // Useful to test that type parameters are plumbed through. |
| 108 | static void ValidateFunctionContext2(const FunctionContext* context) { |
| 109 | assert(context->GetNumArgs() == 2); |
| 110 | assert(context->GetArgType(0)->type == FunctionContext::TYPE_DECIMAL); |
| 111 | assert(context->GetArgType(0)->precision == 2); |
| 112 | assert(context->GetArgType(0)->scale == 1); |
| 113 | assert(context->GetArgType(1)->type == FunctionContext::TYPE_INT); |
| 114 | assert(context->GetIntermediateType().type == FunctionContext::TYPE_DECIMAL); |
| 115 | assert(context->GetIntermediateType().precision == 4); |
| 116 | assert(context->GetIntermediateType().scale == 3); |
| 117 | assert(context->GetReturnType().type == FunctionContext::TYPE_DECIMAL); |
| 118 | assert(context->GetReturnType().precision == 6); |
| 119 | assert(context->GetReturnType().scale == 5); |
| 120 | } |
| 121 | IMPALA_UDF_EXPORT |
| 122 | void AggDecimalIntermediateUpdate(FunctionContext* context, const DecimalVal&, |
| 123 | const IntVal&, DecimalVal*) { |
no test coverage detected