In this short article we will see how we can do a Streaming Transfers of data from a HP Vertica SQL(any database may apply) straight into Google Cloud Storage Bucket using gsutil tool.
The secret of this task is to use ‘-‘ in place of src_url(source) or dst_url(destination) to perform a streaming transfer.
Example:
runuser -l dbadmin -c 'vsql -U dbadmin -w secret_password -F $'','' -At -c "SELECT * FROM schema.table"' | gsutil cp - gs://bktv/schema.table.csv
Copying from <STDIN...
Uploading gs://bktv/schema.table.csv: 38.8 MiB/38.8 MiB