Skip to content

Instantly share code, notes, and snippets.

## Raster File Globbing
COPY table FROM '/path/path/something_*.tiff' WITH (source_type='raster_file')
## Using a data source name:
COPY example_table
FROM 'SELECT * FROM remote_postgres_table WHERE event_timestamp > ''2020-01-01'';'
WITH
(source_type = 'odbc',
sql_order_by = 'event_timestamp',
data_source_name = 'postgres_db_1',
username = 'my_username',
password = 'my_password');
## access omnisql through the container
docker exec -it omnisciserver /omnisci/bin/omnisql -q -s omnisciserver -u myuser -p mypass --db mydb
## restart your omnisci server and web server containers
sudo Docker restart $(sudo docker ps -a -q)
## list your docker containers on your machine
sudo docker ps
## add a unique id to your table
alter table table_name add column unique_id_int BIGINT;
update table_name
set unique_id_int = rowid
## tail the logs from outside the logs directory
ls -rt /var/lib/omnisci/data/mapd_log/*.INFO | tail -100 | xargs tail -f
## tail the logs from within the log directory
tail -f omnisci_server.INFO
## copy files to or from your omnisci server with rsync
rsync -av --progress -e "ssh -i ~/.ssh/yourkey.pem" /path/to/file.csv centos@ec2-yourinstance.compute-1.amazonaws.com:~/.
## copy files to or from your omnisci server with SCP
scp -i /path/yourkey.pem largefile.csv my-instance-user-name@my-instance-public-dns-name:~/.