1

I'm a DB Developer and in my company we're only able to interact with hive through a technical user who owns the specific write permissions for Hive on HDFS. So in practice this looks like this:

  1. I connect through our remote server by using SSH with my user credentials
  2. I switch to the technical hive user by doing sudo su - hive_user (DBA's wont hand out the password for this, so they prefer only giving us specific sudo permission for switching user like this)
  3. I execute a query using beeline -f QUERY_FILE

So as you can see I'm bound to work with the CLI (beeline) all the time, but I'd like to have the convenience using any SQL IDE from my Desktop.

Is there any IDE for Hive, that allows me to connect to our DB as a technical user that can only be accessed by using sudo su - hive_user? A linked manual for this, also would be nice.

1 Answer 1

0

I could not test the below described procedure as I don't have the same infrastructure as you, but I suggest you to try this and come back with further details if any of the steps fails.
DBeaver should be able to do this trick for you:

  1. Install DBeaver, either as an Eclipse plug-in or as a stand-alone application
  2. Create a new connection, for example by clicking on the create connexion icon
  3. Select Apache Hive as connection type, and then click "next": Apache Hive on connection type screen
  4. In Generic JDBC connection setting, go first to "SSH" tab and setup your SSH tunnel: enter image description here
  5. Still in Generic JDBC connection setting, come back to "General" tab and click on "Connection details (name, type, ... )" at the bottom right of the window
  6. On the new screen, click on "Shell commands": Shell commands menu
  7. Then I am less sure, but either in "Before connect" or "After connect", add your command sudo su - hive_user. I would rather expect "Before connect", but it depends in which sequence DBeaver connects to SSH tunnel and execute this command. If the first solution doesn't work then I would test the other one: Shell commands window
  8. Once done, click "Back" and fill in the "General" tab with your Hive user. You click "Test connection ..." to ensure everything works fine. Once it works, you can click on "Finish".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.