Forming insert into query using rimpala in R

孤者浪人 提交于 2019-12-01 09:57:00

问题


I am trying to execute insert into query on impala table using rimpala.query() function through R but I am getting an error. The query that I am executing is:

for(x in nrow)
{
    rite <- paste("INSERT INTO table1 (account_no, data_id, date_id, industry_no, sales_no, sales) VALUES (1445367,",data_frame1$data_id[x] ,",25,11346,23,", data_frame1$sales[x], ")",sep="")
    sql <- rimpala.query(rite);

}

where data_frame1 is the data frame which has bunch of rows and nrow is the number of rows in data_frame1. The first insert into statement executes and fist data is inserted into database but it throws an error just after executing that as

Error in rimpala.query(sql) : SQL error Error: The query did not generate a result set!

How do I remove this error?


回答1:


The error is in the RImpala client, which is using executeQuery to run all queries, even those that modify state. They should be using executeUpdate for DDL and INSERT, UPDATE, or DELETE queries. I've filed an issue upstream for you.



来源:https://stackoverflow.com/questions/25430351/forming-insert-into-query-using-rimpala-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!