Mask the whole given string. Ported from org.apache.hadoop.hive.ql.udf.generic.GenericUDFMask.
| 279 | /// Mask the whole given string. Ported from |
| 280 | /// org.apache.hadoop.hive.ql.udf.generic.GenericUDFMask. |
| 281 | IR_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 | |
| 293 | static inline int GetNumDigits(int64_t val) { |
| 294 | if (val == 0) return 1; |
no test coverage detected