Setting Up an Unload

This section summarizes the steps required to unload data from a Yellowbrick database.
  1. Make sure the target Yellowbrick database is up and running.
  2. Determine the output destination and format of the files to be unloaded.
    • Destination: A local file system where the client user has write permissions or an AWS S3 bucket where the client user has credentials to upload files.
    • Format: CSV (comma-delimited by default) or text (tab-delimited by default)
    Compressed GZIP (.gz) output files are supported.
  3. Run the ybunload command as a user with SELECT privileges on the tables referenced in the command.
    You must define a few essential pieces of information in the command. You can also specify a range of other processing, formatting, and logging options, as needed.
    ybunload [options] -t table -o destination
    • [options]: You will need to set some database connection values if they are not already set with environment variables. Other options depend on the nature of the data and related formatting requirements for the load. For details, see ybunload Options or the online help text.
    • table: the target table for the unload. Alternatively, you can unload the results of a query, using the -s (select) option instead of -t.
    • destination: a local file system path or an S3 bucket. You can also unload to stdout. You can specify a prefix for the output files so that they are named consistently and uniquely for a given unload.
    For more details, see ybunload Options and ybunload Examples.
    Tip: If you are regularly unloading data into the same directory location with the same prefix, use the --truncate-existing option to remove files from previous runs. Otherwise, the output directory may contain a mix of unload files from different runs, or the unload may fail with an error.
  4. Query the following system views to track unload progress and look at completed unload operations: