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

Function CountUtf8Chars

be/src/exprs/string-functions-ir.cc:279–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279static int CountUtf8Chars(uint8_t* ptr, int len) {
280 if (ptr == nullptr) return 0;
281 int cnt = 0;
282 for (int i = 0; i < len; ++i) {
283 if (BitUtil::IsUtf8StartByte(ptr[i])) ++cnt;
284 }
285 return cnt;
286}
287
288IntVal StringFunctions::Utf8Length(FunctionContext* context, const StringVal& str) {
289 if (str.is_null) return IntVal::null();

Callers 2

Utf8LengthMethod · 0.85
InstrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected