Support Questions

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

How can I submit Hive queries via Beeline to specific resource pools?


I'd like to be able to have users submit some queries to specific resource pools that will give assurance of dedicated resources for those specific queries.


By default users queries are going into their root.username pool - and that behavior is fine.  But once a user has refined their query and we'd like to build an excepted SLA for that query I'd like it to run in a restricted, resource defined pool that I can use to help ensure the resouces that will be dedicated to it.


I have found that can be used when submitting jobs from command line - but I'd like to be able to do this from Hive/Pig because I mostly have Hive/Pig users.


Thank you.



So with some digging I found out how to do this in Hue, it is very easy under the Settings tab when executing a query, just enter the & value = poolname.


It looks like Hue has an interface for this in the Pig editor as well under Hadoop Properties.


From Beeline you can do this like this:


beeline -u jdbc:hive2://[HIVESERVER2HOST]:[PORT]/[DBNAME] -e "[SELECT QUERY];" --hiveconf[POOLNAME]


And in Pig the set [poolname] command can be used.


New Contributor

This works for me:


!connect jdbc:hive2://


After that you can execute your queries in beeline