2015-06-27 60 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) 
相关问题