Download a table from OmnisciDB

Is there an easy way I can export a table from Omnisci DB to my computer? Thank you.

Hi @jiajun,

Assuming you are using the OS Edition, to export a table directly from omniscidb to your local computer, you should use a client to connect to omniscidb, like squirrelSQL or DBeaver Community Edition.

With DBEaver, you have to create a connection, selecting Datatse → New Database connection, OmnisciDB, and entering the connection details.

Then select the table you want to export, right-click, then select “Export data” a wizard will be run asking for the export file format (I guess you want CSV to process with something else), the path, and the name of the export file, etc.

Or you can connect to the server run the “copy to” command from omnisql, e.g. (docs here

copy (select * from table) to ‘/path/file_name.txt’

Then move the file to the local computer with an SCP command.

or if you have the omnisql command installed on your local computer, to export a CSV (docs of omnisql here)

echo “select * from table;” /opt/mapd/omnisci-ee-5.6.1-20210510-70a103e2c5-Linux-x86_64-render/bin/omnisql -s remote_host --port port_number -u username -p Password -d, -n >the_export_file.csv

In the end, you need a client with a suitable driver (jdbc, python DB API, or thrift) installed locally on your computer.

If you need something different, fell free to ask.

Best regards,

1 Like

Thank you so much! :heart: