MATE Use Cases
There are many use cases that the DataOps development environment optimizes, including transformation and automated testing using the DataOps Modeling and Transformation Engine (MATE). The development environment and MATE streamline your development process. This allows for swift modifications and instant execution of specific models, enabling you to test outcomes without any delay in data loading.
Examples on this page are using DevReady, the DataOps development environment in your browser.
Modifying an existing MATE model
This example shows how to do simple modifications to an existing DataOps model and preview the results automatically after entering each new SQL line. Let's assume you need to edit a product table to add new columns with specific names and populate them with content.
-
Under your top-level Projects menu, click the project you want to open.
-
Click DataOps.live | develop from the project menu buttons to open the development environment.
-
Navigate to the project modeling SQL file and duplicate the statement about the column name.
The column NAME is duplicated automatically.
-
Edit the statements and name the first column
productcategory
and the secondproductsubcategory
. -
Add the
coalesce
function to the column statements to fill the columns withMisc
.The columns are automatically populated with the new text.
-
Enter another SQL statement to add the new
ListPrice
column to the table.
Adding a test to an existing MATE model
This example shows how to add a test to a layer in an existing DataOps model and automatically preview the results of running the tests. Let's assume you want to test selecting the data for a specific customer.
-
Under your top-level Projects menu, click the project you want to open.
-
Click DataOps.live | Develop from the project menu buttons to open the development environment.
-
Navigate to the project YAML file and add tests to check for null values in specific columns in the customer table.
-
Select dbt Power User on the left vertical bar and click the run button on the panel's top right corner.
The terminal console shows the tests' results defined in the
.yml
file. -
Enter another test condition in the YAML file to test relationships to a field in another table and rerun the test.
Testing MATE model changes
This example shows how to check if the changes added to the DataOps model haven't broken anything downstream.
- Open the project modeling SQL file and add a test to retrieve the ID of all business entities.
- Run the test via the dbt Power User icon.
The terminal console shows the results pointing out any invalid identifier.
-
Remove the statement from the SQL file and run the children's models via the dbt Power User icon.
-
Keep switching between running the test to retrieve the ID of all business entities and running the children's models till you reach the expected results.
Delta runs
A powerful feature of dbt is the ability to work out which model definitions have changed since a specific baseline. The /dataops-cde/scripts/dataops_cde_setup.sh
script, which runs every time a workspace is started creates this baseline and stores it in /workspace/state/
. If you want to run a command (build/test will run the same way) for all the models that you have modified in some way since this baseline, you can run:
cd dataops/modelling/
dbt run --select state:modified+ --state /workspace/state/