HIVE数据库创建表(create table)时报Table 'SEQUENCE_TABLE' already exists
HIVE数据库创建表(create table)时报错:
ERROR : Failed
org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1383) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1388) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.createTableNonReplaceMode(CreateTableOperation.java:158) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.execute(CreateTableOperation.java:116) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.DDLTask.execute(DDLTask.java:84) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:214) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:354) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:327) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:244) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:105) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:367) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:205) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:154) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:149) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:185) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:236) ~[hive-service-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation.access$500(SQLOperation.java:90) ~[hive-service-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:336) ~[hive-service-4.0.0.jar:4.0.0]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_171]
at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_171]
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899) ~[hadoop-common-3.3.6.jar:?]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:356) ~[hive-service-4.0.0.jar:4.0.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_171]
Caused by: org.apache.hadoop.hive.metastore.api.MetaException: JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:158) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.metastore.AbstractHMSHandlerProxy.invoke(AbstractHMSHandlerProxy.java:82) ~[hive-exec-4.0.0.jar:4.0.0]
at com.sun.proxy.$Proxy36.create_table_req(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table(HiveMetaStoreClient.java:4640) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_table(SessionHiveMetaStoreClient.java:174) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:1490) ~[hive-exec-4.0.0.jar:4.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:213) ~[hive-exec-4.0.0.jar:4.0.0]
at com.sun.proxy.$Proxy37.createTable(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1376) ~[hive-exec-4.0.0.jar:4.0.0]
... 27 more
ERROR : DDLTask failed, DDL Operation: class org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation
org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1383) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1388) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.createTableNonReplaceMode(CreateTableOperation.java:158) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation.execute(CreateTableOperation.java:116) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.ddl.DDLTask.execute(DDLTask.java:84) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:214) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:354) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:327) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:244) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:105) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:367) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:205) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:154) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:149) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:185) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:236) ~[hive-service-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation.access$500(SQLOperation.java:90) ~[hive-service-4.0.0.jar:4.0.0]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:336) ~[hive-service-4.0.0.jar:4.0.0]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_171]
at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_171]
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899) ~[hadoop-common-3.3.6.jar:?]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:356) ~[hive-service-4.0.0.jar:4.0.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_171]
Caused by: org.apache.hadoop.hive.metastore.api.MetaException: JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:158) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.metastore.AbstractHMSHandlerProxy.invoke(AbstractHMSHandlerProxy.java:82) ~[hive-exec-4.0.0.jar:4.0.0]
at com.sun.proxy.$Proxy36.create_table_req(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table(HiveMetaStoreClient.java:4640) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_table(SessionHiveMetaStoreClient.java:174) ~[hive-exec-4.0.0.jar:4.0.0]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:1490) ~[hive-exec-4.0.0.jar:4.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:213) ~[hive-exec-4.0.0.jar:4.0.0]
at com.sun.proxy.$Proxy37.createTable(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:1376) ~[hive-exec-4.0.0.jar:4.0.0]
... 27 more
ERROR : FAILED: Execution Error, return code 40000 from org.apache.hadoop.hive.ql.ddl.DDLTask. MetaException(message:JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists)
INFO : Completed executing command(queryId=hadoop_20250114133415_9d08990c-8be3-4e3e-b58b-7a14f829b92b); Time taken: 20.635 seconds
Error: Error while compiling statement: FAILED: Execution Error, return code 40000 from org.apache.hadoop.hive.ql.ddl.DDLTask. MetaException(message:JDOException: Exception thrown calling table.exists() for `SEQUENCE_TABLE`
Root cause: java.sql.SQLSyntaxErrorException: Table 'SEQUENCE_TABLE' already exists) (state=08S01,code=40000)
检查HIVE使用的MySQL数据库,即hive-site.xml中配置的javax.jdo.option.ConnectionURL,javax.jdo.option.ConnectionUser,javax.jdo.option.ConnectionPassword,
连接MySQL数据库,连接正常,use hive;执行正常,show tables出现./hive目录Permission Deny权限不够的情况。检查MySQL的data目录,发现目录下文件所有者为hadoop和hadoop用户组,
修改文件目录权限为mysql:mysql,再登录MySQL,执行show tables命令正常了。再到HIVE数据库创建表,也正常了。
相关推荐
Hive数据仓库全流程开发
- **表创建**: - **基本语法**: ```sql CREATE [EXTERNAL] TABLE [IF NOT EXISTS] table_name (col_name data_type,
hive元数据生成建表语句
例如,一个简单的建表语句可能如下所示:```sqlCREATE DATABASE IF NOT EXISTS mydb;USE mydb;CREATE TABLE IF NOT EXISTS mytable
大数据实验六实验报告:熟悉Hive的基本操作
创建命令如下: ```sql CREATE TABLE IF NOT EXISTS stocks ( exchange STRING, symbol STRING, ymd STRING, price_open
hive构造测试数据方法
```sql CREATE TABLE [IF NOT EXISTS] [db_name.]table_name LIKE existing_table_name; ```对于文件存储格式的选择,可以根据实际需求来决定
在python中使用pyspark读写Hive数据操作
**Hive**: Hive是基于Hadoop的数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供SQL查询功能。Hive提供了数据汇总、分析和查询的高效方法,特别适合大数据处理场景。


