2013-08-05 78 views
3

我試圖創建蜂巢外部表,但不斷收到以下錯誤:蜂巢錯誤創建外部表時(狀態= 08S01,代碼= 1)

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 

我經由beeline命令行界面,它使用節儉HiveServer2連接。

系統:

  • 的Hadoop 2.0.0 cdh4.3.0
  • 蜂巢0.10.0-cdh4.3.0
  • 直線0.10.0-cdh4.3.0
  • 客戶端操作系統 - 紅帽企業Linux服務器版本6.4(聖地亞哥)
+0

我在我的系統中成功執行了命令 –

+0

您是否已經卸載了prev hive安裝? –

+0

謝謝你在你的系統上試用這個聲音。我應該提到我們以前安裝了CDH 4.1並且最近升級到了CDH 4.3。 – yoni

回答

3

問題是,我把外部表指向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";