We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Exporting to Parquet — Vertica Forum

Exporting to Parquet

Jim_KnicelyJim_Knicely - Select Field - Administrator

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.