Skip to content

LOAD TABLE Steps

Follow these steps to set up a load from an object storage bucket into a regular table by using a series of related SQL commands. This is a generally more flexible approach than using the Load Assisant in Yellowbrick Manager because the SQL can be scripted and reused.

  1. Make sure you have an active cloud storage account and know your endpoint URL, security credentials, bucket or storage account name, and so on.
  2. Upload the source files that you want to load from into the bucket or container if they are not already there. Make note of their file type (CSV or gzip, for example).
  3. If the target table for the load does not already exist, create a regular user table that you can load from the source files. Use a CREATE TABLE or CTAS statement. Make sure that the columns and data types align with the source data.
  4. Create the following external objects. If you are creating them for the first time, create them in this order to avoid dependency issues:
  5. An external storage object that defines your object storage endpoint, region, and account credentials. See CREATE EXTERNAL STORAGE.
  6. An external format object that defines the file type and the load options that describe the format of the source files, such as the delimiter and how to handle different field types. (These options have a different naming convention but they correspond in behavior to a subset of the options that are used by the ybload client.) See CREATE EXTERNAL FORMAT.
  7. An external location object that specifies the bucket or container for the source files and provides references to the external storage and format objects that you already created. See CREATE EXTERNAL LOCATION.
  8. Load the target table, using a LOAD TABLE statement. Specify the set of files you want to load, the external location, and the external format. You can also specify some load-processing options; again, these options correspond in behavior to a subset of the options that are used by the ybload client.
  9. Monitor and check the results of the load by running system view queries (sys.load, sys.query). You can also use the activity reports in the Yellowbrick Manager.

Tip: For more details about creating target tables and using ybload options, see Loading Tables.