Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Query on Hive Commands / Beeline

Rising Star

Further to my earlier question (

Wondering how to use the commands beeline -e and beeline -f in shell scripts (bash shell). When I tried running beeline -e command directly on the bash, it says connection not available. So I presume we need to run beeline -u command or a combination of beeline;!connect commands together. But once we execute either of these commands, we will be in beeline shell rather than bash shell and hence beeline -e command is not needed anymore. So wondering what is the purpose of beeline -e command and how to use it without invoking beeline -u command earlier.

I am sure my understanding is wrong somewhere and hence would request to please correct me.


Master Guru

I use -u and -e

here is example

[hive@sunman1 ~]$ beeline -u jdbc:hive2://localhost:10000 -n hive -e 'show tables'
Connecting to jdbc:hive2://localhost:10000
Connected to: Apache Hive (version 1.2.1000.
Driver: Hive JDBC (version 1.2.1000.
| tab_name  |
| airline1  |
1 row selected (0.215 seconds)
Beeline version 1.2.1000. by Apache Hive
Closing: 0: jdbc:hive2://localhost:10000
[hive@sunman1 ~]$


Hi @sunile.manjee

I see you mention hive2 in connection but it says connected to Connected to: Apache Hive (version 1.2...)

How can we connect to Hive-2.1.*