使用Hive处理敏感字段

使用regexp_replace格式:

regexp_replace(address,"正则表达式","替代字符")

(1)匹配所有字符:

select regexp_replace(address, '.*', '***') from table;

(2)匹配指定字符:

select regexp_replace('2016-06-05', '-', '') from table;

(3)匹配特殊字符(换行符):

select regexp_replace(name,'\\\\n','') from table;
发布了118 篇原创文章 · 获赞 25 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/lhxsir/article/details/90374941