Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

COPY gzip file to vertica using python

 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?

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.