| 345 | |
| 346 | template <typename T, typename SetType, bool not_in, InPredicate::Strategy strategy> |
| 347 | inline impala_udf::BooleanVal InPredicate::TemplatedIn( |
| 348 | impala_udf::FunctionContext* ctx, const T& val, int num_args, const T* args) { |
| 349 | if (val.is_null) return BooleanVal::null(); |
| 350 | |
| 351 | BooleanVal found; |
| 352 | if (strategy == SET_LOOKUP) { |
| 353 | SetLookupState<SetType>* state = reinterpret_cast<SetLookupState<SetType>*>( |
| 354 | ctx->GetFunctionState(FunctionContext::FRAGMENT_LOCAL)); |
| 355 | DCHECK(state != NULL); |
| 356 | found = SetLookup(state, val); |
| 357 | } else { |
| 358 | DCHECK_EQ(strategy, ITERATE); |
| 359 | found = Iterate(ctx->GetArgType(0), val, num_args, args); |
| 360 | } |
| 361 | if (found.is_null) return BooleanVal::null(); |
| 362 | return BooleanVal(found.val ^ not_in); |
| 363 | } |
| 364 | |
| 365 | template <typename T, typename SetType> |
| 366 | void InPredicate::SetLookupPrepare( |
nothing calls this directly
no test coverage detected