Search code examples
hadoophivethriftimpersonation

Hive User Impersonation


I need some information on Hive user impersonation. I did some research on it and found that by default HiveServer2 performs a query processing as the user who submitted query but if hive.server2.enable.doAs set it to false then query will be run as user who started hiveserver2 process.

I need to a create jdbc/thirft connection with hiveserver2 with service account (let’s say with user ‘ABC’ is logged in) but would like to run my hive statement with user that I pass , for example with user ‘XYZ’.

Let me know if anyone has done this before.

Is it possible to do this for Hive ?


Solution

  • With Hive impersonation enabled , you can run your queries that you will pass along with connection string .

    For Example

    jdbc:hive2://localhost:10000/default,username,password

    In this case , your job will run with username that you are passing instead of hive user.

    hope this helps.