hive - Hive 通过 hive.security.authorization.createtable.role.grants 撤销授权错误(基于 SQL 标准的 Hive 授权)
问题描述
如何通过 hive.security.authorization.createtable.role.grants 撤销授权?
环境:
主机 172.31.10.119
端口 50033
版本 apache-hive-2.3.5-bin
数据库工具
蜂巢站点.xml
<property>
<name>hive.security.authorization.createtable.role.grants</name>
<value>da:select;</value>
</property>
<property>
<name>hive.users.in.admin.role</name>
<value>root,tools </value>
</property>
启动 hiveserver2
/opt/hive/hive-bin/bin/hiveserver2 --hiveconf hive.server2.thrift.port=50033 --hiveconf hive.server2.webui.port=10003
创建表
/opt/hive/hive-bin/bin/beeline -u jdbc:hive2://172.31.10.119:50033 -n tools
use tools;
create table test1 as select * from tools.test99 limit 10;
show grant on table tools.test1;
+-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor |
+-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| tools | test1 | | | da | ROLE | SELECT | true | 1565061852000 | tools |
+-----------+--------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
- 撤销对角色 da 的选择
set role damin;
revoke select on table tools.test1 from role da;
- 错误日志
失败:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1。在工具授予的对象 [type=TABLE_OR_VIEW, name=tools.test1] 上找不到主体 [name=da, type=ROLE] 的特权 Privilege [name=SELECT, columns=null]
解决方案
推荐阅读
- cmake - CMake 用 add_custom_target 中的相对“../../”替换命令的部分绝对路径
- server - isc-dhcp-server.service 失败
- ruby - Xcode 在运行阶段找不到 ruby 脚本
- ios - Xcode 说 found nil,但实际值不是 nil
- api - Web服务与http和api有什么区别?
- java - Android 10+ 未从 MediaStore 检索 DATE_TAKEN 信息
- spring-boot - 从实现 jar 中排除 spring-cloud-deployer-spi-scheduler-test-app
- python - 在 Alembic 迁移文件头中包含用户名
- web-scraping - 有没有办法获取抽搐视频数据?
- java - ArrayList 索引超出范围但 HashSet 没有问题