Hive数据库base64 加解密字段或字符串

sql 复制代码
加码:
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;

相关推荐
网络豆13 小时前
Apache Hive 鸿蒙 PC 适配全记录:以 Qt 客户端打通 HiveQL、监控与元数据访问
hive·apache·harmonyos
fastjson_1 天前
Hive3.1.3 安装使用
hive
Gl�ria6 天前
Hadoop MapReduce/Hive 数据倾斜完整排查
hive·hadoop·mapreduce
Gl�ria6 天前
Hadoop Hive 和 YARN 的关系
数据仓库·hive·hadoop
fastjson_10 天前
Hive 自定义函数
数据仓库·hive·hadoop
Gent_倪10 天前
MySQL 与 Hive 语法异同点详解
数据库·hive·mysql
邀星月为媒13 天前
从零打造一个属于自己的 AI Agent:Core Hive Agent 开源项目解析
人工智能·hive·开源
BI专家之路13 天前
安装linux/hadoop/jdk/hive
linux·hive·hadoop
fastjson_14 天前
Hive 基础函数
数据仓库·hive·hadoop
邀星月为媒18 天前
正式迁移 Gitee:core-site-hive 与 core-hive-agent 后续更新只认这两个地址
hive·hadoop·gitee