Skip to main content
Question

Vertica bulk upload failing from R

  • Dec 10, 2020 12:00 PM UTC
  • 1 reply
  • 8 views

mvishruth

I have created a temporary table in my vertica and I have a csv file on a centos 7 server where my Rstudio server is installed.
dbSendQuery(vertica, "COPY hpcom_usr.VM_test FROM LOCAL \'/opt/mount1/MarketBasketAnalysis/Code/test.csv\' enclosed by \'\"\' DELIMITER \',\' direct REJECTED DATA \'./code/temp/rejected.txt\' EXCEPTIONS \'./code/temp/exceptions.txt\'")
When i am running this query . I am getting this error

Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set", :

Unable to retrieve JDBC result set
JDBC ERROR: [Vertica]JDBC A ResultSet was expected but not generated from query "COPY hpcom_usr.VM_test FROM LOCAL '/opt/mount1/musoumit/MarketBasketAnalysis/Code/test.csv' enclosed by '"' DELIMITER ',' direct REJECTED DATA './code/temp/rejected.txt' EXCEPTIONS './code/temp/exceptions.txt'". Query not executed.
I am running R studio >1.0 R 3.6.3 and tidyverse 1.0.3

1 reply

mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • Dec 10, 2020 4:31 PM UTC

Looks like the statement or the statement parsing fail, and then JDBC complains "ResultSet was expected but not generated".
Try to run the same statement first in VSQL