rhive.write.table() :缺少参数 "tableName",没有默认值
rhive.write.table() : argument "tableName" is missing, with no default
我导入了 csv 数据,并尝试使用以下代码保存在 Hive 中,但没有成功:
> 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,所以我不知道这里有什么问题。
您没有向函数 rhive.write.table()
传递任何参数。
尝试rhive.write.table(base2)
。
我使用了下面的代码,成功地在 Hive 中创建了 table,同时也出来了 massageage;
> 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
我们可以找到已经在 table 列表中创建的 base2 table,但是根本没有插入任何行:
> 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)
我导入了 csv 数据,并尝试使用以下代码保存在 Hive 中,但没有成功:
> 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,所以我不知道这里有什么问题。
您没有向函数 rhive.write.table()
传递任何参数。
尝试rhive.write.table(base2)
。
我使用了下面的代码,成功地在 Hive 中创建了 table,同时也出来了 massageage;
> 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
我们可以找到已经在 table 列表中创建的 base2 table,但是根本没有插入任何行:
> 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)