TransWikia.com

IDE Access to Hive without user password?

Database Administrators Asked by Mayak on November 28, 2021

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.

One Answer

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".

Answered by FloT on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP