系统吧 专业的电脑操作系统,支持重装各种原版系统xp/win7/win8/win10 这个系统怎么样?试试系统吧系统,体验办公系统畅快愉悦感。 各种电脑系统安装过程一样,神一般的畅快!
-->
当前位置:主页 > 电脑技术 >

hive权限用Sentry详细使用测试文档(4)

作者:谢昕芙 分类:电脑技术 发布时间:2021-07-10 16:56:00

GRANT SELECT ON TABLE temp.student TO ROLE role2; 0: jdbc:hive2://uhadoop-4wvgxxla-master2:1000> GRANT SELECT ON TABLE temp.student TO ROLE role2; No rows affected (0.145 seconds)0: jdbc:hive2://uhad...

GRANT SELECT ON TABLE temp.student TO ROLE role2;

0: jdbc:hive2://uhadoop-4wvgxxla-master2:1000> GRANT SELECT ON TABLE temp.student TO ROLE role2; No rows affected (0.145 seconds)0: jdbc:hive2://uhadoop-4wvgxxla-master2:1000> show role grant group user2;+--------+---------------+-------------+----------+| role | grant_option | grant_time | grantor |+--------+---------------+-------------+----------+| role2 | false | 0 | -- |+--------+---------------+-------------+----------+1 row selected (0.129 seconds)0: jdbc:hive2://uhadoop-4wvgxxla-master2:1000> show grant role role2;+-----------+----------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+| database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor |+-----------+----------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+| db2 | | | | role2 | ROLE | * | true | 1583739057000 | -- || temp | student | | | role2 | ROLE | SELECT | false | 1583740481000 | -- |+-----------+----------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+2 rows selected (0.125 seconds)

验证如下:[hadoop@uhadoop-4wvgxxla-master1 ~]$ beeline -u "jdbc:hive2://uhadoop-4wvgxxla-master2:10000" -n user2 -e "show databases;"Transaction isolation: TRANSACTION_REPEATABLE_READ+----------------+| database_name |+----------------+| db2 || default || temp |+----------------+3 rows selected (0.614 seconds)

[hadoop@uhadoop-4wvgxxla-master1 ~]$ beeline -u "jdbc:hive2://uhadoop-4wvgxxla-master2:10000" -n user2 -e "use temp;show tables;"No rows affected (0.476 seconds)+-----------+| tab_name |+-----------+| student |+-----------+1 row selected (0.282 seconds)Beeline version 2.3.3 by Apache Hive[hadoop@uhadoop-4wvgxxla-master1 ~]$ beeline -u "jdbc:hive2://uhadoop-4wvgxxla-master2:10000" -n user2 -e "select * from temp.student;"Transaction isolation: TRANSACTION_REPEATABLE_READ+--------------+-----------------------+---------------+---------------+-----------------------+| student.sno | student.sname | student.ssex | student.sage | student.sdept |+--------------+-----------------------+---------------+---------------+-----------------------+| 200215121 | 李勇 | 男 | 20 | CS |+--------------+-----------------------+---------------+---------------+-----------------------+1 row selected (0.667 seconds)Beeline version 2.3.3 by Apache Hive

[hadoop@uhadoop-4wvgxxla-master1 ~]$ beeline -u "jdbc:hive2://uhadoop-4wvgxxla-master2:10000" -n user2 -e "insert into temp.student values(100215122,'刘晨','女',19,'CS');"Transaction isolation: TRANSACTION_REPEATABLE_READError: Error while compiling statement: FAILED: SemanticException No valid privilegesUser user2 does not have privileges for QUERY // 用户user2没有QUERY的特权 The required privileges: Server=uhadoop-4wvgxxla-master1->Db=temp->Table=student->action=insert->grantOption=false; (state=42000,code=40000)Closing: 0: jdbc:hive2://uhadoop-4wvgxxla-master2:10000

xp 更多>>
win7 更多>>
win8 更多>>
win10 更多>>
U盘 更多>>
电脑技术 更多>>
网站地图 | 豫ICP备2021035069号-4 | 友情链接qq:191064436
系统吧

版权所有 © 2012-2023 系统吧 免责声明:本站资源均收集于互联网,其著作权归原作者所有,如果有侵犯您权利的资源,请来信告知,我们将及时删除相应资源。