hive 解密_hive 中自定义 base64 加密 解密 UDF 函数

一、maven依赖

org.apache.hadoop

hadoop-client

2.7.3

org.apache.hive

hive-exec

1.2.1

org.apache.maven.plugins

maven-shade-plugin

1.4

package

shade

*:*

META-INF/*.SF

META-INF/*.DSA

META-INF/*.RSA

META-INF/spring.handlers

com.neu.hive.UDF.ToUpperCaseUDF

META-INF/spring.schemas

二、base64 解密代码

public class Decode extends UDF {

private static final Logger log = Logger.getLogger(Decode.class);

private static final String charset = "utf-8";

public String evaluate(String param){

if (param == null) {

return null;

}

byte[] bytes = Base64.decodeBase64(param);

try {

String res = new String(bytes,charset);

return res;

} catch (Unsupp

你可能感兴趣的:(hive,解密)