The Vertica Forum is getting a makeover! The site will be undergoing maintenance from Tuesday 8/13 to Friday 8/16. We appreciate your patience and cooperation during this time.

Exporting to Parquet

Vertica can export a table, columns from a table, or query results to files in the Parquet format.

Example:

dbadmin=> SELECT * FROM dim;
c2 |  c3
----+------
  1 | TEST
(1 row)

dbadmin=> EXPORT TO PARQUET (directory = '/home/dbadmin/dim') AS SELECT * FROM dim;
Rows Exported
---------------
             1
(1 row)

One restriction is the path to export must not exist.

dbadmin=> EXPORT TO PARQUET (directory = '/home/dbadmin/dim') AS SELECT * FROM dim;
ERROR 8193:  Directory [/home/dbadmin/dim/] exists. Please remove it or specify another directory

How do I get around that? Remove the directory prior to exporting!

dbadmin=> \! rm -fr /home/dbadmin/dim

dbadmin=> EXPORT TO PARQUET (directory = '/home/dbadmin/dim') AS SELECT * FROM dim;
Rows Exported
---------------
             1
(1 row)

Helpful link:
https://my.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/SQLReferenceManual/Statements/EXPORTTOPARQUET.htm

Sign In or Register to comment.

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