Skip to main content

Setting up the dev_orders model

Now that you've set up the dev_payments model, setting up the dev_orders model is similar and should be straightforward.

The source table

The source table for the dev_orders model is the raw.raw_orders table, which has the following columns:

img Raw Order Schema

Creating the dev_orders model

In the left panel of the Visitran UI, navigate to Models > No Code, right click on it and select New Model. This brings up a new model dialog.

Let's name the model dev_orders and click on Create. This will create the model. Now, select that model from the left panel of the Visitran UI. This will bring up the model configuration dialog similar to the one below.

img Configure Dev Orders

  • Set the Heirarchy to Root model, which is the default
  • To configure the source, select the right schema and set the table to raw_orders
  • To configure the destination, select the right schema and set the table to dev_orders
  • Click on Apply. This will create the model.

The Transformations

We'll be creating two transformations on top of the source table:

  1. Rename the id column to order_id
  2. Rename the user_id column to customer_id

We saw how to rename columns in the dev_payments model. Let's do the same with both the columns we need to rename.

img Rename Column

Similarly, let's rename the user_id column to customer_id.

The transformed dev_orders model

Let's verify that the columns have been renamed by looking for the renamed column indicators in the data grid.

img Rename Column