dbt Analytics Engineering 認定試験の学習要領を読んでみる

Moden Data Stackの重要な技術として有名なdbtを理解したい。
と言いつつも使う機会がなかなか無いな、という点と、認定試験があるようなので、
まずは認定試験に合格することを目的に、知識を獲得していきたい。

SnowPro Certificationsと同様に参考書も問題集も無いが、
公式に学習要領のようなものが無茶苦茶丁寧に書かれている。
もちろん試験に向けた資料なので偏りだったり不足はあるのだろうけれど、
何も知らない素人がステップバイステップで物事を理解していくには大分心強い。

dbt Analytics Engineering Certification Exam Study Guide

この記事では、この学習要領を上から順に読んでいく。
後続の記事で(ブログドリブンで)頭に入れた知識をアウトプットしていく。

トピック一覧

何を理解したら 「dbtのことを理解した」 と言えるのか。
dbtが備えている機能とその詳細が試験要項に一覧化されている。
初心者には本当に助かる。これらが頭の中で整理されて当たり前になったときが次のステップ。

何も知らない状況では分からない言葉や概念が多い。
振り返らず5分程度で訳を付けて終了。何となく全体像が見えてくる。

Topic 1: Developing dbt models

  • Identifying and verifying any raw object dependencies
  • Understanding core dbt materializations
  • Conceptualizing modularity and how to incorporate DRY principles
  • Converting business logic into performant SQL queries
  • Using commands such as run, test, docs and seed
  • Creating a logical flow of models and building clean DAGs
  • Defining configurations in dbt_project.yml
  • Configuring sources in dbt
  • Using dbt Packages

dbtモデルの実装方法と理論について。
dbtは物理的に存在するDBオブジェクトを抽象化するフレームワークであって論理と物理のマップがある。
抽象的な構造から見た具体化方式について理解する。
dbtを構成する概念の理解とDRY(Don’t Repeat Yourself)法則をどう実現するか。
ビジネスロジックを高性能なクエリに変換する仕組みを理解する。
run,test,docs,seedなどのコマンドの使い方を理解する。
モデルのフローとDAGs、dbt_project.ymlの定義方法、sourceの構成方法を理解する。

Topic 2: Debugging data modeling errors

  • Understanding logged error messages
  • Troubleshooting using compiled code
  • Troubleshooting .yml compilation errors
  • Distinguishing between a pure SQL and a dbt issue that presents itself as a SQL issue
  • Developing and implementing a fix and testing it prior to merging

dbtモデルのデバッグ方法について。
ログとして記録されたエラーメッセージの解釈方法を理解する。
dbtによりコンパイル/生成されたコードを使ったトラブルシュート方法を理解する。
.ymlコンパイルエラーに対するトラブルシュート方法を理解する。
SQL自身の問題なのかdbtに纏わる問題なのかを区別する方法を理解する。
(git branchに?)mergeする前に修正/テストする方法を理解する。

Topic 3: Monitoring data pipelines

  • Understanding and testing the warehouse-level implications of a model run failing at different points in the DAG
  • Understanding the general landscape of tooling

作ったパイプラインの監視。
DAG のさまざまなポイントでモデル実行が失敗した場合のウェアハウスレベルの影響の理解+テスト方法。
(ウェアハウスレベルってどこのレベル??)

Topic 4: Implementing dbt tests

  • Using generic, singular and custom tests on a wide variety of models and sources
  • Understanding assumptions specific to the datasets being generated in models and to the raw data in the warehouse
  • Implementing various testing steps in the workflow
  • Ensuring data is being piped into the warehouse and validating accuracy against baselines

dbtテストの実装。
様々な種類のモデル・ソースに対する generic, singular, customテストの使用方法。
モデルで生成されるデータセットとウェアハウス内の生データに特有の仮定を理解する。(意味不..)
ワークフロー内にテストステップを実装する方法。
データがウェアハウスにパイプされていることを確認し、ベースラインに対する精度を検証する。

Topic 5: Deploying dbt jobs

  • Understanding the differences between deployment and development environments
  • Configuring development and deployment environments
  • Configuring the appropriate tasks, settings and triggers for the job
  • Understanding how a dbt job utilizes an environment in order to build database objects and artifacts
  • Using dbt commands to execute specific models

デプロイ環境と開発環境の違いを理解する。
コンフィグによってデプロイ環境と開発環境を作る。
ジョブの適切なタスク、設定、トリガーの構成。
dbtジョブがDBオブジェクト・生成物をビルドするために環境をどのように使うかを理解する。
特定のdbtモデルを実行するためのdbtコマンドの使用方法。

Topic 6: Creating and Maintaining dbt documentation

  • Updating dbt docs
  • Implementing source, table, and column descriptions in .yml files
  • Using dbt commands to generate a documentation site
  • Using macros to show model and data lineage on the DAG

dbt documentationの作成・維持。
dbt docsの更新、.ymlファイル内に source,table,列定義を書く方法。
documentationサイトを生成するためのdbtコマンドの使用方法。
DAGにおけるモデルとリネージを表示するマクロの使用方法。

Topic 7: Promoting code through version control

  • Understanding concepts and working with Git branches and functionalities
  • Creating clean commits and pull requests
  • Merging code to the main branch

gitとのコラボw。版管理。
版管理の概念。Git branchとの連携とその機能。
cleanコミットとプルリク。mainブランチへのマージ。

Topic 8: Establishing environments in data warehouse for dbt

  • Understanding environment’s connections
  • Understanding the differences between production data, development data, and raw data

データウェアハウスの各環境とdbtの接続を確立する。
環境との接続確立方法を理解する。本番環境データ、開発環境データ、生データの違いを理解する。

学び方

素人が脱初心者するためのステップ。なんだかやたら丁寧。
各ステップで参照すべきリソースがまとまっている。順番を無視する理由は特にないので最初から見ていく。

Checkpoint 0 – 前提条件

SQLの理解が必要。結合、集計、CTEsの書き方、ウィンドウ関数に詳しくないといけない。
Gitの理解が必要。ブランチ戦略や基本的なgitコマンド、プルリクの方法など。

Checkpoint 1 – Build a Foundation

やたら丁寧だな…

オンライン動画。
dbt Fundamentals
読み物
dbt viewpoint
ドキュメント
Source properties
Node selection syntax
dbt_project.yml
General resource properties

やってみる

  • Creating a dbt project from scratch to deployment
  • Debugging errors

コマンド達

  • dbt compile
  • dbt run
  • dbt source freshness
  • dbt test
  • dbt docs generate
  • dbt build
  • dbt run-operation

Checkpoint 2 – Modularity and Refactoring

オンライン動画
Refactoring SQL for Modularity
Readings
How we structure our dbt projects
Your Essential dbt Project Checklist
ドキュメント
Refactoring legacy SQL to dbt
やってみる
– Refactoring SQL for performance and clarity

Checkpoint 3 – Doing More with dbt

オンライン動画
Jinja, Macros, and Packages
Advanced Materializations
Analyses and Seeds
ドキュメント
Exposures
Env_var
Target
Schema
Database
やってみる
– Utilizing packages and macros in a dbt project
– Implementing all core materializations into a dbt project
– Implementing seeds
コマンド達
– dbt snapshot
– dbt seed

Checkpoint 4 – Deployment and Testing

オンライン動画
Advanced Testing
Advanced Deployment

読み物
The exact grant statements we use in a dbt project
The exact GitHub pull request template we use at dbt Labs
How to review an analytics pull request
How we configure Snowflake

ドキュメント
Tags
Hooks & Operations
Custom Schema
Threads

やってみる
– Defining environments in your data platform
– Defining environments in dbt
– Promoting code through git including use of multiple branches, pull requests
– Troubleshooting errors in production runs
– Defining dbt jobs for optimal performance

まとめ

本来探し回らないと見つからないドキュメントが集まっていて良さそう。
このレベルでまとめるだけで何となく全体像が見えてきたような。
後続の記事で(ブログドリブンで)インプットした内容をアウトプットしていく。