HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }
今天用Hive的JDBC实例时出现了HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }的错误,日志如下。
org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:)
at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:)
at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:)
at zimo.hadoop.hive.Hive.main(Hive.java:)
Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }
at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:)
at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:)
at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:)
at org.apache.hive.service.cli.operation.Operation.run(Operation.java:)
at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:)
at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:)
at org.apache.hive.service.cli.session.HiveSessionProxy.access$(HiveSessionProxy.java:)
at org.apache.hive.service.cli.session.HiveSessionProxy$.run(HiveSessionProxy.java:)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)
at org.apache.hadoop.hive.shims.HadoopShimsSecure.doAs(HadoopShimsSecure.java:)
at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:)
at com.sun.proxy.$Proxy22.executeStatementAsync(Unknown Source)
at org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:)
at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:)
at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:)
at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:)
at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
从日志可以清楚地看出,出现该错误的原因是因为我们创建的用户没有执行‘Create’操作的权限,所以我们需要将权限授予该用户。
解决办法:
hive> set system:user.name=hadoop;
1.给当前用户权限:
给用户当前权限:
hive> grant create on database default to user hadoop;
OK
Time taken: 0.146 seconds
或者给用户所有权限 :
hive> grant all on database default to user hadoop; OK Time taken: 0.146 seconds
2.在其他有权限的数据库里创建表
比如 当前用户在db1里面有权限,而在default里面是没有的那么可以:
use db1; create table default.test ( name string );
这样也可以创建。
然后,我们的问题就能得到解决了!
以上就是博主为大家介绍的这一板块的主要内容,这都是博主自己的学习过程,希望能给大家带来一定的指导作用,有用的还望大家点个支持,如果对你没用也望包涵,有错误烦请指出。如有期待可关注博主以第一时间获取更新哦,谢谢!
版权声明:本文为博主原创文章,未经博主允许不得转载。
HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }的更多相关文章
- Hplsql报错:...HiveSQLExpection:Error while compiling statement:No privilege 'Select' found for inputs {.....}
实践hplsql时,遇到的问题总结一下,若有不对的地方,欢迎交流. 一.Hplsql简介 hplsql的介绍详见:http://lxw1234.com/archives/2015/09/492.htm ...
- hive 权限:Authorization failed:No privilege 'Create' found for outputs .
创建表报错: create table test ( name string ); Authorization failed:No privilege 'Create' found for outpu ...
- Hive 报错 Error while compiling statement: FAILED: ParseException line 1:0 character '' not supported here (state=42000,code=40000)
Hive报错 Error while compiling statement: FAILED: ParseException line 1:0 character '' not supported h ...
- Error: Error while compiling statement: FAILED: SemanticException Unable to determine if hdfs://hadoopNode2:8020/user/hive/warehouse/test is encrypted...
1.发现问题: 在hive客户端或者beeline查询hive表时候报错: 根据报错信息查看,是在集群namenode做了HA之后,产生的hdfs路径不对的问题: 2.解决问题,修改hive元数据my ...
- HiveServer2 的jdbc方式创建udf的修改(add jar 最好不要使用),否则会造成异常: java.sql.SQLException: Error while processing statement: null
自从Hive0.13.0开始,使用HiveServer2 的jdbc方式创建udf的临时函数的方法由: ADD JAR ${HiveUDFJarPath} create TEMPORARY funct ...
- SSDT – Error SQL70001 This statement is not recognized in this context-摘自网络
March 28, 2013 — arcanecode One of the most common errors I get asked about when using SQL Server Da ...
- iReport 5.6.0 Error: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : data 最优解决方案
问题描述 近期学习iReport(个人使用的是最新版本的 iReport-5.6.0,MySQL是 5.5.56版本),遇到一些问题,在安装完成后,创建了数据库,配置了MySQL数据库连接信息,新建报 ...
- 解决hiveserver2报错:java.io.IOException: Job status not available - Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
用户使用的sql: select count( distinct patient_id ) from argus.table_aa000612_641cd8ce_ceff_4ea0_9b27_0a3a ...
- Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in
学习php的命名空间,直接把手册的代码粘贴过来,却报错了:Fatal error: Namespace declaration statement has to be the very first s ...
随机推荐
- K Sum(2 Sum,3 Sum,4 Sum,3-Sum Closest)
算是经典算法问题了.这里主要针对只存在一个解或者只需要求一个解的情况描述一下解题思路.若需要找到所有可能解,方法需要略作调整.如有问题,欢迎指正. 2 sum: 如果已排序,可直接用夹逼法,即两指针从 ...
- 关于surf显示立体图,可视化分析数据
如果想判断一个点(x,y)对应的ZV值是否在平面上方.平面上.平面下方,只要将(x,y)带入方程,得到z. 如果ZV大于>Z,则在平面上方:如果ZV<Z,则在方面下方:若ZV=Z,则在平面 ...
- Tiny4412学习杂记
1.Android 挂载NFS 使用 busybox mount 来替代mount命令 2.修改Uboot中fastboot最大buff 使用U-boot烧写Android5.0的时候出现 remo ...
- qt程序异常结束crashed
今天调试以前写的opencv的程序发现每次一点运行就报错误 Starting D:\Qt\QProjects\build-HelloWorld-lian-Debug\debug\HelloWorld. ...
- 5种最流行的AI编程语言
人工智能如今正是蓬勃发展的时期,许多开发者都在跃跃欲试,如果你写想转做AI相关的开发,那么来了解更多与AI开发有关的内容吧,本文将介绍创建AI程序时可以使用的5种最佳语言. 人工智能如今正是蓬勃发展的 ...
- nfs(Network FileSystem)的简单配置
如果想要在window和linux之间共享文件,那么用samba.如果仅仅想在Unix like系统之间共享文件,那么可以用NFS. 这篇文章分为两个部分,第一部分只是简单的用:照着写的步骤一步步来就 ...
- 【转】WebElement.getText()为空解决方法
WebElement.getText()为空解决方法 当使用getText()获取一个普通的链接文本时: <a href="http://www.baidu.com"> ...
- miRNA
MicroRNA (miRNA) 是一类内生的.长度约为20-24个核苷酸的小 RNA,其在细胞内具有多种重要的调节作用.每个 miRNA 可以有多个靶基因的表达,而几个 miRNA 也可以调节同一 ...
- grep的常用命令语法
grep的常用命令语法 1. 双引号引用和单引号引用在g r e p命令中输入字符串参数时,最好将其用双引号括起来.例如:"m y s t r i n g".这样做有两个原因,一是 ...
- Unity3d 脚本使用规则
脚本是Unity游戏开发的重要组成部分,通过脚本可以监听游戏中的相关事件和响应玩家的输入,并在游戏中安排事件发生.另外,脚本还可用于创建图形效果,控制对象的物理行为等.在Unity中使用脚本是需要注意 ...