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

Function CheckAndWarnCodePoint

be/src/exprs/mask-functions-ir.cc:115–122  ·  view source on GitHub ↗

Checks whether the unicode code point is malformed, i.e. illegal or incomplete, and warns if it is. Returns true if any warning is added.

Source from the content-addressed store, hash-verified

113/// Checks whether the unicode code point is malformed, i.e. illegal or incomplete, and
114/// warns if it is. Returns true if any warning is added.
115static bool CheckAndWarnCodePoint(FunctionContext* ctx, uint32_t code_point) {
116 if (code_point == utf::illegal || code_point == utf::incomplete) {
117 ctx->AddWarning(Substitute("String contains $0 code point. Return NULL.",
118 code_point == utf::illegal ? "illegal" : "incomplete").c_str());
119 return true;
120 }
121 return false;
122}
123
124/// Mask the substring in range [start, end) of the given string value. Using rules in
125/// 'MaskTransform'. Indices are counted in UTF-8 code points.

Callers 1

MaskSubStrUtf8Function · 0.85

Calls 2

SubstituteFunction · 0.85
AddWarningMethod · 0.80

Tested by

no test coverage detected