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

Function ValidateFunctionContext3

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

Defines AggStringIntermediate(DECIMAL(20,10), BIGINT, STRING) returns DECIMAL(20,0) intermediate STRING. Useful to test decimal input types with string as intermediate types.

Source from the content-addressed store, hash-verified

142// intermediate STRING.
143// Useful to test decimal input types with string as intermediate types.
144static 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}
156IMPALA_UDF_EXPORT
157void AggStringIntermediateUpdate(FunctionContext* context, const DecimalVal&,
158 const BigIntVal&, const StringVal&, StringVal*) {

Calls 2

GetNumArgsMethod · 0.80
GetArgTypeMethod · 0.80

Tested by

no test coverage detected