89 lines
3.5 KiB
JSON
89 lines
3.5 KiB
JSON
{
|
|
"id": "492c2c87-b04a-544a-b5dd-eb808036bf85",
|
|
"snapshot": "dbt",
|
|
"instruction": "Separate the single dbt model customers into separate ones and use the ``ref`` function to build models on top of others. 1) Create a new SQL file, models/stg_customers.sql, with the SQL from the customers common table expressions (CTE) in the original query. 2) Create a second new SQL file, models/stg_orders.sql, with the SQL from the orders CTE in the original query. These two stg models are materialized as view. 3) Edit the SQL in models/customers.sql file to refer two these two staged models and execute dbt run. Please ensure the running succeeds.",
|
|
"source": [
|
|
"https://docs.getdbt.com/guides/manual-install?step=11"
|
|
],
|
|
"config": [
|
|
{
|
|
"type": "download",
|
|
"parameters": {
|
|
"files": [
|
|
{
|
|
"url": "https://drive.usercontent.google.com/download?id=1-Nn0leqKdVnA1gQ6s50wkGSa2xZauEUe&export=download&authuser=0&confirm=t&uuid=d7596b15-ae39-43cb-a940-03bee8a0c961&at=APZUnTXwp5xMjHpi5AYVF3Z_bfw2:1705582080467",
|
|
"path": "/home/user/projects/jaffle_shop.zip"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "execute",
|
|
"parameters": {
|
|
"command": ["/bin/bash", "-c", "unzip -oq /home/user/projects/jaffle_shop.zip -d /home/user/projects/ && rm /home/user/projects/jaffle_shop.zip && mkdir -p /home/user/.dbt"]
|
|
}
|
|
},
|
|
{
|
|
"type": "download",
|
|
"parameters": {
|
|
"files": [
|
|
{
|
|
"url": "https://drive.usercontent.google.com/download?id=1xkXjiFhRNoiX_-0zikfdwzJ8UvdXEVAt&export=download&authuser=0&confirm=t&uuid=bc8d0eb8-99b3-4be7-b110-c0a56246d2d2&at=APZUnTUaPD_Z6ov6uMWDNf5rSy3-:1705978221799",
|
|
"path": "/home/user/.dbt/profiles.yml"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"trajectory": "trajectories/",
|
|
"related_apps": [
|
|
"dbt",
|
|
"duckdb"
|
|
],
|
|
"evaluator": {
|
|
"func": [
|
|
"check_database",
|
|
"check_dbt_command"
|
|
],
|
|
"conj": "and",
|
|
"result": [
|
|
{
|
|
"type": "vm_file",
|
|
"path": "/home/user/projects/jaffle_shop/jaffle_shop.duckdb",
|
|
"dest": "jaffle_shop.duckdb"
|
|
},
|
|
{
|
|
"type": "vm_command_line",
|
|
"command": ["/bin/bash", "-c", "cd /home/user/projects/jaffle_shop; source ~/anaconda3/etc/profile.d/conda.sh && conda activate dbt; dbt run"]
|
|
}
|
|
],
|
|
"expected": [
|
|
{
|
|
"type": "cloud_file",
|
|
"path": "https://drive.usercontent.google.com/download?id=1rtRXtgKiwyWSVPCbDVkjYXh8AMni7t1W&export=download&authuser=0&confirm=t&uuid=6e4331f7-4e46-4894-910f-9af77450534d&at=APZUnTXySypK2OcEdOb8FVHQnbd7:1705583620817",
|
|
"dest": "gold_jaffle_shop.duckdb"
|
|
},
|
|
{
|
|
"type": "rule",
|
|
"rules": [
|
|
["contains", "of 3 OK created sql view model .*\\.stg_customers", ""],
|
|
["contains", "of 3 OK created sql view model .*\\.stg_orders", ""],
|
|
["contains", "3 of 3 OK created sql table model .*\\.customers", ""],
|
|
["contains", "Completed successfully", ""],
|
|
["contains", "PASS=3", ""],
|
|
["contains", "TOTAL=3", ""]
|
|
]
|
|
}
|
|
],
|
|
"options": [
|
|
{
|
|
"db_type": "duckdb",
|
|
"check_type": [
|
|
"table-schema-content",
|
|
"view-schema-content"
|
|
]
|
|
},
|
|
{}
|
|
]
|
|
}
|
|
} |