Support Questions
Find answers, ask questions, and share your expertise

Filter Option with Ranger for Hive Tables

Contributor

Hello,

When we use a Filter with Ranger on Hive tables: is it possible to define a dynamic value ?

My use case :

I have different groups on my application. Each group has at least one user.

Data could be accessed by only an appropriate group.

My SQL request : select * from table t1, table t2 where t1.id=t2.id and t2.group="group_admin".

Instead of "group_admin" I would like to put a dynamic value.

Is it possible or any suggestions ?

Thks for your helps

3 REPLIES 3

Re: Filter Option with Ranger for Hive Tables

Guru

@Smart Data Starting in HDP 2.6.0 you can use variables in ranger policies. So you could do a row-level filtering using where user={user}. I am not sure of the full range of variables that you can use (or if it is limited to user only) so you may want to try where group_admin={group}. [See comment for using additional variables]

Useful references:

You may also want to look at this post: https://community.hortonworks.com/articles/59582/create-dynamic-row-level-filter-in-ranger.html

Re: Filter Option with Ranger for Hive Tables

Guru

Re: Filter Option with Ranger for Hive Tables

Contributor

Hi @Greg Keys

Thks so much for your comment. I will try your advices and let you know.