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:
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.
- Set the
Heirarchy
toRoot 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:
- Rename the
id
column toorder_id
- Rename the
user_id
column tocustomer_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.
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.