base64加密解密的hive udf函数

依赖hadoop,hive相关包,

源码见附件。

https://pan.baidu.com/s/1Ay0kX5Zd_DXUoSijEE8zqw

		add jar hdfs://nn.dc.sh-wgq/group/p_sdo_data/p_sdo_data_etl/udf/base64.jar;
		CREATE TEMPORARY FUNCTION encodebase64 AS 'com.sdo.hive.udf.EncodeBase64';
		CREATE TEMPORARY FUNCTION decodebase64 AS 'com.sdo.hive.udf.DecodeBase64';
		
		hive> select encodebase64('liuxiaowen1234') from lxw_t1 limit 1;
		bGl1eGlhb3dlbjEyMzQ=
		hive> select decodebase64('bGl1eGlhb3dlbjEyMzQ=') from lxw_t1 limit 1;
		liuxiaowen1234

你可能感兴趣的:(hive,基础知识)