Skip to main content

COPY gzip file to vertica using python

  • December 10, 2015
  • 0 replies
  • 8 views

Nips81

 As mentioned in the docs, I am trying to COPY gzip file to vertica using python, my copy command is below

 

import vertica_python
conn_info
= {******}connection = vertica_python.connect(**conn_info)cur = connection.cursor()cur.execute("DROP TABLE IF EXISTS home01")cur.execute( "CREATE TABLE home01( ....;")cur.copy("copy home01(path, directories, files, reported_bytes, actual_bytes, path_level) from local '/work/directory.home01.out.gz' GZIP ;")

My error is

 

Traceback (most recent call last):
File "./pyvertica.py", line 16, in cur.copy("copyhome01(path, directories, files, reported_bytes, actual_bytes, path_level) from local '/work/directory.home01.out.gz' GZIP ;")

TypeError: copy() takes exactly 3 arguments (2 given)

 

I can copy the same file if its decompressed, but with the compressed mode I cannot.What is the error here?