Defines AggStringIntermediate(DECIMAL(20,10), BIGINT, STRING) returns DECIMAL(20,0) intermediate STRING. Useful to test decimal input types with string as intermediate types.
| 142 | // intermediate STRING. |
| 143 | // Useful to test decimal input types with string as intermediate types. |
| 144 | static void ValidateFunctionContext3(const FunctionContext* context) { |
| 145 | assert(context->GetNumArgs() == 3); |
| 146 | assert(context->GetArgType(0)->type == FunctionContext::TYPE_DECIMAL); |
| 147 | assert(context->GetArgType(0)->precision == 20); |
| 148 | assert(context->GetArgType(0)->scale == 10); |
| 149 | assert(context->GetArgType(1)->type == FunctionContext::TYPE_BIGINT); |
| 150 | assert(context->GetArgType(2)->type == FunctionContext::TYPE_STRING); |
| 151 | assert(context->GetIntermediateType().type == FunctionContext::TYPE_STRING); |
| 152 | assert(context->GetReturnType().type == FunctionContext::TYPE_DECIMAL); |
| 153 | assert(context->GetReturnType().precision == 20); |
| 154 | assert(context->GetReturnType().scale == 0); |
| 155 | } |
| 156 | IMPALA_UDF_EXPORT |
| 157 | void AggStringIntermediateUpdate(FunctionContext* context, const DecimalVal&, |
| 158 | const BigIntVal&, const StringVal&, StringVal*) { |
no test coverage detected