加码:
select BASE64('[{"name":"晁盖","mid":"002J81Pr09ytag","id":12384782}]')
解码:
SELECT string(unbase64('W3sibmFtZSI6IuS4geeoi+mRqyIsIm1pZCI6IjAwMko4MVByMDl5amFnIiwiaWQiOjE0NTE2OTl9XQ==')) AS decoded_data;
如果遇到如下问题:
Wrong arguments ''wukong'': No matching method for class org.apache.hadoop.hive.ql.udf.UDFBase64 with (string). Possible choices: _FUNC_(binary) (state=42000,code=10014)
可以试一下下面的内容:
select base64(cast('wukong' as binary));
select unbase64('ZHVhbmh3Cg==') as names;