When a user submits a query via Beeline, HS2 in turn runs the query with user hive as doas is set to false.
How could a user kill the job? It should be a command via beeline to ask HS2 to kill on behalf of a user.
XYZ $ yarn application -kill application_1461543063850_12340
16/05/16 11:56:13 INFO impl.TimelineClientImpl: Timeline service address: ...
16/05/16 11:56:13 INFO client.RMProxy: Connecting to ResourceManager at ...
Killing application application_1461543063850_12340
Exception in thread "main" org.apache.hadoop.yarn.exceptions.YarnException: java.security.AccessControlException: User XYZ cannot perform operation MODIFY_APP on application_1461543063850_12340
That should work. My original thought is to grant a user the ability to kill his own job. It is OK to promote him to the admin of the Yarn queue.
Only the Hive users can kill the job or the instance on which user job is running will have privileges to kill the job. If you want the By setting hive.server2.enable.doAs=true will give access to the user who running job can kill.