### What's dbt Artifacts? - dbt artifact ဆိုတာက dbt ကနေ auto generate ထုတ်လိုက်တဲ့ JSON file တွေကို ရည်ညွှန်းပါတယ် ။ ဒီ JSON file တွေထဲမှာ dbt project နဲ့ ပတ်သတ်တဲ့ metadata တွေ နဲ့ run execution တိုင်းရဲ့ log တွေပါဝင်တယ်လို့ အကြမ်းဖျဥ်းပြောလို့ ရပါတယ်။ - အောက်မှာ ဖော်ပြထားတဲ့ အရေးကြီးတဲ့ အချက်အလက်တွေ ပါဝင်ပါတယ် - - Model တစ်ခုချင်းဆီရဲ့ Execution times (model တည်ဆောက်ရန် ကြာချိန်) - Model တည်ဆောက်ရာမှာ အောင်မြင် (သို့) ကျရှုံးသည့် ဖြစ်စဥ်များ - Model တွေ အချင်းချင်းကြားက Dependency relationships (ကိုင်းကျွန်းမှီ ချိတ်ဆက်မှု) - dbt run ရဲ့ performance ဒေတာ ဒါကြောင့် dbt artifacts ကို ကျနော်တို့ dbt pipelines တည်ဆောက်ရာမှ ဖြစ်ပေါ်လာတဲ့ logs (သို့) blueprints တွေကို ဆိုလို့ ရပါတယ်။ ### dbt Artifacts - JSON Files - dbt artifact ရဲ့ အဖွဲ့ဝင် လို့ မှတ်ယူရမယ့် JSON files တွေကတော့ အောက်ပါ အတိုင်း ဖြစ်ပါတယ်။ - `semantic_manifest.json` - `manifest.json` - `catalog.json` - `run_results.json` - `sources.json` - ဒီ JSON files တွေ အားလုံးကို သက်ဆိုင်ရာ dbt commands ကို run လိုက်တဲ့အခါမှာ `target` ဆိုတဲ့ folder အောက်မှာ dbt ကနေ အလိုအလျောက် ဖိုင်တွေ တည်ဆောက်သွားတာ ဖြစ်ပါတယ်။ - dbt artifacts တွေရဲ့ ဖွဲ့စည်းပုံ structure ကို https://schemas.getdbt.com/ မှာ ကြည့်လို့ ရပါတယ်။ File တစ်ခုချင်းဆီ ရဲ့ သဘောတရား နဲ့ အသုံးဝင်ပုံများကို ဆက်လက် ရေးသားသွားပါမယ်။ ### Catalog JSON - Data Warehouse ထဲမှာ ရှိတဲ့ tables တွေ ၊ views တွေရဲ့ information ၊ metadata ၊ errors တွေအကြောင်း ပါဝင်နေတဲ့ File တစ်ခုပါ ။ - `dbt docs generate` command ကို run တဲ့အခါ dbt ကနေ auto create လုပ်ပါတယ်။ ဒီ JSON file နဲ့ ပတ်သတ်တဲ့ အသေးစိတ် ကို ဒီ [documentation](https://docs.getdbt.com/reference/artifacts/catalog-json) မှာ ဆက်ဖတ်လို့ ရပါတယ်။ ### Manifest JSON - dbt project ထဲမှာ ရှိတဲ့ resources တွေ အားလုံး (models, tests, macros, etc) ရဲ့ အချက်အလက်တွေ အပြည့်အစုံ ပါဝင်တဲ့ file တစ်ခု ဖြစ်ပါတယ်။ - dbt ရဲ့ command အားလုံးနီးပါး (`deps`, `clean`, `debug`, `init` ကလွဲပြီး) run တဲ့အခါတိုင်းမှာ ဒီ JSON file ကို generate ထုတ်ပေးပါတယ်။ အသေးစိတ်ကို [documentation](https://docs.getdbt.com/reference/artifacts/manifest-json) မှာ ဆက်ဖတ်ပါ။ ### Run Results JSON - dbt အနေနဲ့ လုပ်ဆောင်ရမယ့် job/process တစ်ခုခု ကို အောင်အောင်မြင်မြင် execute လုပ်ပြီးသွားတဲ့ နောက်မှာ အသုံးပြုခဲ့တဲ့ node (model, test, etc) တွေနဲ့ ပတ်သတ်ပြီး ကြာချိန် ၊ status info စသဖြင့် အချက်အလက်တွေ ပါဝင်တဲ့ file တစ်ခု ဖြစ်ပါတယ်။ `run_results.json` ကို အသုံးပြုပြီး ပျှမ်းမျှ model runtime , test တွေ fail ဖြစ်နေတဲ့ နှုန်း ၊ snapshots ကနေ captured လုပ်လိုက်တဲ့ record changes အရေအတွက် စသဖြင့် အရေးပါတဲ့ data insights တွေကို aggregate လုပ်ယူလို့ ရပါတယ်။ - သတိပြုရမှာက executed လုပ်လိုက်တဲ့ nodes နဲ့ ပတ်သတ်တာတွေပဲ run_results မှာ ပါဝင်ပါမယ်။ အကယ်ရွေ့ မတူညီတဲ့ အခြေအနေတွေအကြားမှာ တစ်ခုထက်ပိုပြီး multiple run (သို့) test လုပ်တာမျိုးဆိုရင် တစ်ခုချင်းဆီကနေ မတူညီတဲ့ run_results တွေ ရပါလိမ့်မယ်။ - dbt ရဲ့ command တွေ ([`build`](https://docs.getdbt.com/reference/commands/build) [`clone`](https://docs.getdbt.com/reference/commands/clone) [`compile`](https://docs.getdbt.com/reference/commands/compile) [`docs generate`](https://docs.getdbt.com/reference/commands/cmd-docs) [`retry`](https://docs.getdbt.com/reference/commands/retry) [`run`](https://docs.getdbt.com/reference/commands/run) [`seed`](https://docs.getdbt.com/reference/commands/seed) [`show`](https://docs.getdbt.com/reference/commands/show) [`snapshot`](https://docs.getdbt.com/reference/commands/snapshot) [`test`](https://docs.getdbt.com/reference/commands/test) [`run-operation`](https://docs.getdbt.com/reference/commands/run-operation)) run တဲ့အခါတိုင်းမှာ ဒီ JSON file ရပါမယ်။ အသေးစိတ် ကိုတော့ [documentation](https://docs.getdbt.com/reference/artifacts/run-results-json) မှာ ဆက်ဖတ်ပေးပါ။ ### References - ကိုးကားစာရင်း - https://docs.getdbt.com/reference/artifacts/dbt-artifacts - https://www.phdata.io/blog/what-are-dbt-artifacts/ -