PageRenderTime 36ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/test/queries/clientnegative/authorization_part.q

#
text | 33 lines | 23 code | 10 blank | 0 comment | 0 complexity | e501eb0c242e4066fac4ec927f2f3ff1 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. create table authorization_part_fail (key int, value string) partitioned by (ds string);
  2. ALTER TABLE authorization_part_fail SET TBLPROPERTIES ("PARTITION_LEVEL_PRIVILEGE"="TRUE");
  3. set hive.security.authorization.enabled=true;
  4. grant Create on table authorization_part_fail to user hive_test_user;
  5. grant Update on table authorization_part_fail to user hive_test_user;
  6. grant Drop on table authorization_part_fail to user hive_test_user;
  7. grant select on table src to user hive_test_user;
  8. -- column grant to group
  9. grant select(key) on table authorization_part_fail to group hive_test_group1;
  10. grant select on table authorization_part_fail to group hive_test_group1;
  11. show grant group hive_test_group1 on table authorization_part_fail;
  12. insert overwrite table authorization_part_fail partition (ds='2010') select key, value from src;
  13. show grant group hive_test_group1 on table authorization_part_fail(key) partition (ds='2010');
  14. show grant group hive_test_group1 on table authorization_part_fail partition (ds='2010');
  15. select key, value from authorization_part_fail where ds='2010' order by key limit 20;
  16. insert overwrite table authorization_part_fail partition (ds='2011') select key, value from src;
  17. show grant group hive_test_group1 on table authorization_part_fail(key) partition (ds='2011');
  18. show grant group hive_test_group1 on table authorization_part_fail partition (ds='2011');
  19. select key, value from authorization_part_fail where ds='2011' order by key limit 20;
  20. select key,value, ds from authorization_part_fail where ds>='2010' order by key, ds limit 20;
  21. revoke select on table authorization_part_fail partition (ds='2010') from group hive_test_group1;
  22. select key,value, ds from authorization_part_fail where ds>='2010' order by key, ds limit 20;
  23. drop table authorization_part_fail;