I am trying to connect to hive installed in my machine through Beeline client. when I give the 'beeline' command & connect to Hive, the client is asking for user name & password
!connect jdbc:hive2://localhost:10000/default
I have no idea what is the user name and password I am supposed to give. Do I have to add the credential(user name & password) in some configuration file?
Configuring the ConnectionSpecify your username for a proxy user or for the Beeline CLI. Specify your Beeline CLI password. Specify your JDBC Hive host that is used for Hive Beeline. Specify your JDBC Hive port that is used for Hive Beeline.
beeline --incremental=true
Note: The command line option “—incremental=true” is optional, but will extend the amount of time that you can remain idle and not have your connection dropped.
!connect jdbc:hive2://silver-server- hive.app.google.com:10000/default
Note: You will be prompted for your username & password. USE user name and Password
beeline> !connect jdbc:hive2:// silver-server-hive.app.google.com:10000/default scan complete in 3ms Connecting to jdbc:hive2:// silver-server-hive.app.google.com:10000/default Enter username for jdbc:hive2:// silver-server-hive.app.google.com:10000/default:suman Enter password for jdbc:hive2:// silver-server-hive.app.google.com:10000/default: *********
set mapred.job.queue.name=<your queue name>;
Note: You need to set a queue in order to run queries.
USE google_map_data;
Note: You should be in a database when executing queries.
!reconnect jdbc:hive2:// silver-server-hive.app.google.com:10000/default;
!quit
Notes:
beeline -u jdbc:hive2:// silver-server-hive.app.google.com:10000\ -n <yourname> -p <yourpassword> --incremental=true**
Beeline supports a rich set of SQL query functions.
SHOW DATABASES; USE <database>; SHOW TABLES; DESC <table>; DESC FORMATTED <table>;
SELECT * FROM google_map_city limit 25;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With