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

Method ConstantSubstringFn

be/src/exprs/like-predicate.cc:240–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240BooleanVal LikePredicate::ConstantSubstringFn(FunctionContext* context,
241 const StringVal& val, const StringVal& pattern) {
242 if (val.is_null) return BooleanVal::null();
243 LikePredicateState* state = reinterpret_cast<LikePredicateState*>(
244 context->GetFunctionState(FunctionContext::THREAD_LOCAL));
245 if (state->search_string_sv_.Len() == 0) return BooleanVal(true);
246 StringValue pattern_value = StringValue::FromStringVal(val);
247 return BooleanVal(state->substring_pattern_.Search(&pattern_value) != -1);
248}
249
250BooleanVal LikePredicate::ConstantStartsWithFn(FunctionContext* context,
251 const StringVal& val, const StringVal& pattern) {

Callers

nothing calls this directly

Calls 4

BooleanValClass · 0.85
GetFunctionStateMethod · 0.80
LenMethod · 0.45
SearchMethod · 0.45

Tested by

no test coverage detected