1
我使用下面的代碼導入csv數據並在Hive中創建了表,但也出現了錯誤masseage;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(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)