gpt4 book ai didi

hadoop - 创建外部表时Hive报错(state=08S01,code=1)

转载 作者:可可西里 更新时间:2023-11-01 14:31:54 26 4
gpt4 key购买 nike

我试图在 Hive 中创建一个外部表,但不断收到以下错误:

create external table foobar (a STRING, b STRING) row format delimited fields terminated by "\t" stored as textfile location "/tmp/hive_test_1375711405.45852.txt";
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask (state=08S01,code=1)
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask (state=08S01,code=1)
Aborting command set because "force" is false and command failed: "create external table foobar (a STRING, b STRING) row format delimited fields terminated by "\t" stored as textfile location "/tmp/hive_test_1375711405.45852.txt";"

/tmp/hive_test_1375711405.45852.txt的内容是:

abc\tdef

我正在通过使用 Thrift HiveServer2beeline 命令行界面进行连接。

系统:

  • Hadoop 2.0.0-cdh4.3.0
  • 配置单元 0.10.0-cdh4.3.0
  • 直线 0.10.0-cdh4.3.0
  • 客户端操作系统 - Red Hat Enterprise Linux Server 6.4 版(圣地亚哥)

最佳答案

问题是我将外部表指向 HDFS 中的文件而不是目录。神秘的 Hive 错误消息真让我失望。

解决方案是创建一个目录并将数据文件放在那里。要针对上述示例修复此问题,您需要在 /tmp/foobar 下创建一个目录,并将 hive_test_1375711405.45852.txt 放入其中。然后像这样创建表:

create external table foobar (a STRING, b STRING) row format delimited fields terminated by "\t" stored as textfile location "/tmp/foobar";

关于hadoop - 创建外部表时Hive报错(state=08S01,code=1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18061120/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com