Support Questions

Find answers, ask questions, and share your expertise

HiveServer2 with kerberos ,when executing "select count(*) from student_info",unExpected exception returned

New Contributor

org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask at org.apache.hive.service.cli.operation.Operation.toSQLException( at org.apache.hive.service.cli.operation.SQLOperation.runQuery( at org.apache.hive.service.cli.operation.SQLOperation.access$300( at org.apache.hive.service.cli.operation.SQLOperation$2$ at Method) at at at org.apache.hive.service.cli.operation.SQLOperation$ at java.util.concurrent.Executors$ at at java.util.concurrent.Executors$ at at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at



@yifan zhao

Can you do the below change in the Ambari-Hive-Config


If set as above HiveServer2 performs the query processing as the user who submitted the query "select count(*) from student_info" in a kerberized environment this user MUST have run the kinit to grab a Kerberos ticket and in an LDAP integrated environment it could be a service account (for ease of management) which could be assigned to users just like a ROLE

When set to false the above query will run as the user that the hiveserver2 process runs as i.e Hive

Advantages of the above setup

  • Hive permissions management through Ranger policies
  • Assign every user on a specific Queue. and control the ACLs mappings for Yarn

Hope that helps

New Contributor

thanks for your reply.

As your thought , "Run as end user instead of Hive user" property is set to be true. but I do logIn in the summited user principal and keytab, through UserGroupInformation.login and then connect hiveServer2 through jdbc mode. but it still throw the same exception.
Any further changes for my code...? forword for your reply

New Contributor

Solved the problom,follow 3 steps

1. add the user in all hadoop nodes

2. mkdir in hdfs "/user" directory, for example, /user/test

3. grant hdfs "/user" privilege in "ranger" to the user

finally make it


@yifan zhao You can take look here Link, hope it will help you.