使用rodbc包,我可以手动编写一个hiveql语句来为我创建一个表,但是有没有办法利用sqlsave()函数为我将整个表写入hive?
myconn <- odbcConnect(dsn = "dsn1",uid="username1",pwd="password1")
test <- data.frame(a = c(1,2,3,4,5), b = c("one", "two", "three", "four",
"five"))
sqlSave(myconn, dat = test, tablename = "schema1.test")
我得到以下错误:
Error in sqlSave(myconn, dat = test, tablename = "cao_analytics.test") :
HY000 80 [Hortonworks][Hardy] (80) Syntax or semantic analysis error thrown
in server while executing query. Error message from server: Error while
compiling statement: FAILED: ParseException line 1:34 cannot recognize input
near '"rownames"' 'varchar' '(' in column specification
[RODBC] ERROR: Could not SQLExecDirect 'CREATE TABLE cao_analytics.test
("rownames" varchar(255), "a" DOUBLE, "b" varchar(255))'
暂无答案!
目前还没有任何答案,快来回答吧!