Decimal4Value... => Decimal8Value
| 130 | |
| 131 | // Decimal4Value... => Decimal8Value |
| 132 | IMPALA_UDF_EXPORT |
| 133 | DecimalVal VarSum(FunctionContext* context, int n, const DecimalVal* args) { |
| 134 | int64_t result = 0; |
| 135 | bool is_null = true; |
| 136 | for (int i = 0; i < n; ++i) { |
| 137 | const FunctionContext::TypeDesc* desc = context->GetArgType(i); |
| 138 | if (desc->type != FunctionContext::TYPE_DECIMAL || desc->precision > 9) { |
| 139 | context->SetError("VarSum() only accepts Decimal4Value (precison <= 9)"); |
| 140 | return DecimalVal::null(); |
| 141 | } |
| 142 | if (args[i].is_null) continue; |
| 143 | result += args[i].val4; |
| 144 | is_null = false; |
| 145 | } |
| 146 | if (is_null) return DecimalVal::null(); |
| 147 | return DecimalVal(result); |
| 148 | } |
| 149 | |
| 150 | IMPALA_UDF_EXPORT |
| 151 | DoubleVal NO_INLINE VarSumMultiply(FunctionContext* context, |
nothing calls this directly
no test coverage detected