COPY TO
command. This guide outlines the methods for exporting data, including specifying delimiters, handling headers and controlling null value representation.
COPY table_name (column_name) TO {'file_path' | STDOUT}
WITH (option, …);
table_name
: existing table from which the data will be exportedcolumn_name
: optionally list of columns to be exported. If omitted, all columns are exportedTO
: destination for the exported data
file_path
: path to the CSV file where the data will be writtenSTDOUT
: exports the data to the standard output streamoption
: available options below
TRUE
or FALSE
, with default set to FALSE
)film_export.csv
, including a header row and using a semicolon as the delimiter.
1. Creating a table
Ensure that the table exists in your Oxla instance. If the table does not exist, create one using the following command:
table_name
with your target table (e.g. film)file_path
with the full path where the data will be writtenHEADER
to include a header row with column namesfilm_export.csv
to ensure the data has been successfully exported
COPY TO
command with object storage credentials. This command allows you to transfer data to a cloud storage services like AWS S3, Google Cloud Storage or Azure Blob Storage directly from your Oxla instance.
object storage
: AWS_CRED
,AZURE_CRED
or GCS_CRED
(depending on your provider)object_storage_credentials
: for accessing your cloud storageaws_region
: AWS region associated with the storage servicekey_id
: key identifier for authenticationaccess_key
: access key for authenticationendpoint_url
: URL endpoint for the storage serviceNULL
values will be represented as ‘unknown’ as specified in the NULL
option<path_to_credentials>
: path to JSON credentials file<json_credentials_string>
: contents of the GCS’s credentials filetenant_id
: tenant identifier representing your organization’s identity in Azureclient_id
: client identifier used for authenticationclient_secret
: secret identifier acting as a password for authentication.