Taposh DuttaRoy
Taposh DuttaRoy

Reputation: 411

Unable to use beeline -f filename

I am unable to run

beeline -f file_queries.hql

Error:
$ beeline -f edip_validations_hql.hql
beeline> {My Query}
No current connection

Note: I am on Kerberos so I have done kinit. Usually for beeline to work I have to do a

 !connect jdbc:hive2://XX.xxxx.xx.org:10000/default;principal=hive/[email protected]

However I am not clear how this would work. Any pointers would help.

Upvotes: 5

Views: 22440

Answers (3)

Mahendran V M
Mahendran V M

Reputation: 3496

I just found out one way to run File in Hive Beeline.

Just Go to the Hive beeline

//use !run to run script File
beeline> !run ///C:/ScriptFile

Above Method surely helpful to run file beeline after connect to the hive server.

Upvotes: 5

Taposh DuttaRoy
Taposh DuttaRoy

Reputation: 411

All -

I found out how to do this.

 beeline -u 'jdbc:hive2://server.domain.<>.com:10000/default;principal=hive/[email protected]' -f filename.hql

Upvotes: 12

mstang
mstang

Reputation: 157

You should be able to add that connect string to your .hql file prior to the query. But I have not seen a way to pass a keytab in the connect string and that generic hive principal will ask for a user/password. For now, I'm still using hive -f which works with my existing kinit. Hope you find another solution since for now beeline -f is useless to me on a secure cluster.

Upvotes: 0

Related Questions