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

Function MaskImpl

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

Mask the whole given string. Ported from org.apache.hadoop.hive.ql.udf.generic.GenericUDFMask.

Source from the content-addressed store, hash-verified

279/// Mask the whole given string. Ported from
280/// org.apache.hadoop.hive.ql.udf.generic.GenericUDFMask.
281IR_ALWAYS_INLINE static inline StringVal MaskImpl(FunctionContext* ctx,
282 const StringVal& val, int masked_upper_char, int masked_lower_char,
283 int masked_digit_char, int masked_other_char) {
284 if (val.is_null || val.len == 0) return val;
285 if (!ctx->impl()->GetConstFnAttr(FunctionContextImpl::UTF8_MODE)) {
286 return MaskSubStr(ctx, val, 0, val.len, masked_upper_char,
287 masked_lower_char, masked_digit_char, masked_other_char);
288 }
289 return MaskSubStrUtf8(ctx, val, 0, val.len, masked_upper_char, masked_lower_char,
290 masked_digit_char, masked_other_char);
291}
292
293static inline int GetNumDigits(int64_t val) {
294 if (val == 0) return 1;

Callers 1

MaskMethod · 0.85

Calls 7

MaskSubStrFunction · 0.85
MaskSubStrUtf8Function · 0.85
GetConstFnAttrMethod · 0.80
implMethod · 0.80
ToYearMonthDayMethod · 0.80
ToDateValMethod · 0.80
DateValueClass · 0.50

Tested by

no test coverage detected