我正在使用下面的SQL语句在Google Cloud Bucket中创建配置单元表。
CREATE TABLE schema_name.table_name (column1 decimal(10,0), column2 int, column3 date)
PARTITIONED BY(column7 date) STORED AS ORC
LOCATION 'gs://crazybucketstring/'
TBLPROPERTIES('ORC.COMPRESS'='SNAPPY');
然后,我使用distcp
命令将数据加载到该表中,现在,当我尝试删除表时,它失败并显示以下错误消息,即使我尝试删除空表也失败了。hive>>DROP TABLE schema_name.table_name;
**Error:** Error while processing statement:
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.DDLTask.MetaException
(message:java.lang.IllegalArgumentException: `hadoopPath must not be null`)
(state=08S01,code=1)
我还使用gsutil rm -r gs://
命令从Google Cloud Storage存储桶中删除了文件,但仍然无法删除表并给出相同的错误同样在运行
msck repair table
时,它给出以下错误。FAILED:
Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask (state=08S01,code=1)
任何想法可能有什么问题吗?
最佳答案
问题与存储桶位置有关。我将尝试逐步解释如何重新创建它以及如何解决它。同样的问题也导致无法运行msck repair
命令。
如何重新创建它:
LOCATION 'gs://crazybucketstring/'
下面
LOCATION gs://crazybucketstring/schemname/tableaname/
存储桶的行为与表相同,它不能删除存储桶,它只能
删除文件。
为了删除表T1,我拼命地删除了存储桶,并使用
gsutil rm -r
命令清空了存储桶,并尝试了msck repair table tablename
,奇怪的是msck repair
命令失败,并显示以下错误消息>> msck repair table tablename
Error: Error while processing statement: FAILED:
Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask (state=08S01,code=1)
像往常一样,DROP命令仍然不起作用。解决方案:
最终我得到了可行的想法。
ALTER TABLE TABLENAME SET LOCATION gs://crazybucketstring/schemname/tableaname/
This issue is related to Table Location which we should deal with carefully while creating more than 1 Table in same bucket. Best practice is to use different subdirectories inside bucket to create different tables and avoid using just bucket path as table location specially if you have to create multiple tables in same bucket. Thank you and feel free to reach out to Me for Big Data issues.
关于hadoop - Drop Hive Table和MSCK修复失败,表存储在Google云存储桶中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63146214/