Providing Access to Views in Hive

3.8k views Asked by At

I am new to Hadoop/Hive. I have a question related to VIEWS in Hive.

I have a requirement in Hive where I need to give access to specific rows of a table to some users and specific columns of a table to some users. I know we can create VIEWS in Hive. But is it possible to provide access using GRANT statement only to VIEWS to users without giving access to the base tables?

If this is not possible, is there any other method to provide only column or row level access in Hive?

Please let me know. Thanks for the assistance.

2

There are 2 answers

1
Andrey Tatarinov On

First it's important to understand what Hive really is. Hive is just a compiler (more or less) of SQL statements into MapReduce tasks, it does control data storage layer. So there is no such concept as access management in Hive.

Also it's necessary to understand that "table" in Hive is just an HDFS folder with files. It means that you can manage access on per-table basis with standard set of HDFS access management tools.

The best you can do is to limit access on HDFS level to database and export parts of your data into "public tables" for less privileged users to read.

0
Lester Martin On

Yes, you can definitely grant access to the View and restrict the backing Table. Take a peek at https://github.com/HortonworksUniversity/Essentials/blob/master/demos/ranger/README.md for some demo notes as well as a video recording of myself doing that very thing using Ranger.