2015-06-27 62 views
0

我導入CSV數據,並嘗試使用下面的代碼在蜂巢拯救,卻徒勞無功:rhive.write.table():參數「表名」缺失,沒有默認設置

> base2<-read.csv("/home/hadoop/R/base.csv") 
    > base2 
     id devid name 
    1 7 1007  R 
    2 8 1008 python 
    3 9 1009 Ruby 


    > rhive.write.table() 
    >Error: argument "data" is missing, with no default 

我還檢查類型是data.frame,所以我不知道這裏有什麼問題。

回答

1

您沒有將任何參數傳遞給函數rhive.write.table()

嘗試rhive.write.table(base2)

+0

謝謝,但使用rhive.write.table(BASE2)之後。它仍然顯示錯誤消息:錯誤:參數「tableName」丟失,沒有默認值 – Samoth

0

我使用了下面的代碼,併成功地在Hive中創建了表,但也出現了masseage;

> rhive.write.table(base2, tableName = 'base2', sep=',') 

    Error: java.sql.SQLException: Query returned non-zero code: 40000,  
    cause: FAILED: SemanticException Line 1:17 Invalid 
    path ''/rhive/data/root/base2_64dbfcaf0e6fbd092165717b91de64'': No 
    files matching path 
    hdfs://master:9000/rhive/data/root/base2_64dbfcaf0e6fbd092165717b91de64 

,我們可以發現已經表列表創建BASE2表,但沒有行插入可言:

> rhive.list.tables() 
      tab_name 
    1  base 
    2  base2 
    3  emplyoee 

    >rhive.query("SELECT * FROM base2") 
    [1] base2.id base2.devid base2.name 
    <0 rows> (or 0-length row.names) 
相關問題