Loading Data with Database Extractor

So far, you have learned to load data into KBC manually and via a GoogleDrive extractor. Let’s now load data from an external database with the help of the Snowflake Database extractor (the procedure is same for all our database extractors.

We will use our own sample Snowflake database, so do not worry about having to get database credentials from anyone.

Configure Snowflake Extractor

Start by going into the Extractors section of KBC and create a new extractor.

Screenshot - Create a new Extractor

Find Snowflake. You can use the search feature to find it quickly.

Screenshot - Create a new Database Extractor

Similarly to the GoogleDrive extractor, the Snowflake extractor can have multiple configurations. As each configuration represents a single database connection, we only need one configuration. Continue with Create New Configuration.

Screenshot - New Database Extractor Configuration

Name the configuration.

Screenshot - Create a new Database Extractor Configuration

Now, set up credentials to the source database. Set

  • Host to kebooladev.snowflakecomputing.com,
  • Port to 443, and
  • Username, Password, Database and Schema to HELP_TUTORIAL.
  • Warehouse to DEV.

Test the credentials and save them.

Screenshot - Database Extractor Credentials

For extracting tables from the database, add SQL queries. Each query produces a single table in Storage.

Screenshot - Database Extractor Introduction

Each database query needs to have a name, SQL command and a target table in Storage.

Screenshot - Add database query

One by one, create and save the following three queries:

  • SELECT * FROM account; with output table in.c-tutorial.account
  • SELECT * FROM user; with output table in.c-tutorial.user
  • SELECT * FROM opportunity; with output table in.c-tutorial.opportunity

You will get the following configuration. Click on Run Extraction to load the data from the database into your tables in Storage.

Screenshot - Add database query

Running the extractor creates a background job that

  • connects to the database,
  • executes the queries, and
  • stores results of the queries in specified tables in Storage.

When a job is running, a small orange circle appears under Last runs, along with RunId and other info on the job. Green is for success, red for failure. Click on the indicator, or the info next to it, for more details.

Once the job is finished, click on the names of the tables to inspect their contents. In case you had loaded the tables manually before, their contents will not change at all. The extractor overwrites the table contents, and the manually loaded CSV files match the contents of the sample database.

Now when you know how to use the Snowflake extractor, continue with the rest of the tutorial.