Exporting a table out of Presto using command line

500 Views Asked by At

Is there an easy way to export a table out of Presto using command line? I need it in csv format.

1

There are 1 best solutions below

0
Mahesh On

You can use below command to set the output in CSV format. Make sure to set PRESTO_PASSWORD before you run it.

./presto --server {host}:{port_number} --catalog {catalog_name}
--schema {schema_name} --user {user_name} --password --execute "SELECT * FROM table_name" --output-format CSV > output_filename.csv