Mask the first 'mask_char_count' chars of the given string. Ported from org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskFirstN.
| 247 | /// Mask the first 'mask_char_count' chars of the given string. Ported from |
| 248 | /// org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskFirstN. |
| 249 | IR_ALWAYS_INLINE static inline StringVal MaskFirstNImpl(FunctionContext* ctx, |
| 250 | const StringVal& val, int mask_char_count, int masked_upper_char, |
| 251 | int masked_lower_char, int masked_digit_char, int masked_other_char) { |
| 252 | if (mask_char_count <= 0 || val.is_null || val.len == 0) return val; |
| 253 | if (mask_char_count > val.len) mask_char_count = val.len; |
| 254 | if (!ctx->impl()->GetConstFnAttr(FunctionContextImpl::UTF8_MODE)) { |
| 255 | return MaskSubStr(ctx, val, 0, mask_char_count, masked_upper_char, masked_lower_char, |
| 256 | masked_digit_char, masked_other_char); |
| 257 | } |
| 258 | return MaskSubStrUtf8(ctx, val, 0, mask_char_count, masked_upper_char, |
| 259 | masked_lower_char, masked_digit_char, masked_other_char); |
| 260 | } |
| 261 | |
| 262 | /// Mask the last 'mask_char_count' chars of the given string. Ported from |
| 263 | /// org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskLastN. |
no test coverage detected