Upgrade to Pro — share decks privately, control downloads, hide ads and more …

進化を加速させる データ基盤CI/CDの実践 / accelerating-data-pla...

pei0804
February 27, 2025
230

進化を加速させる データ基盤CI/CDの実践 / accelerating-data-platform-ci-cd

Data Engineering Study #28 データ基盤のCI/CD
https://forkwell.connpass.com/event/339761/

データ基盤のCI/CDは、データの品質担保やスキーマ変更など、従来のソフトウェア開発とは異なる課題に直面します。本講演では、これらの技術的な課題と多様なステークホルダーの要求に応えながら、いかに安定的で俊敏な変更管理を実現するかについて、実践的な戦略と実装例を共有。データ基盤の進化を加速させるための具体的なアプローチについて解説します。

pei0804

February 27, 2025
Tweet

More Decks by pei0804

Transcript

  1. コード • データ変換ロジック ◦ dbt, Python • パイプライン制御 ◦ AWS

    Step Functions, Airflow, Dagster • 品質検証 ◦ dbtテスト, Great Expectations
  2. limit_ci @ dbt-snowflake select * from {{source(...)}} {{limit_ci()}} {%- macro

    limit_ci(rows_limit=10) -%} {%- if target.name == "ci" %} limit {{ rows_limit }} {%- endif -%} {%- endmacro -%} 発行されるSQLイメージ select * from hoge limit 10
  3. filter_partition_and_limit_ci @ dbt-snowflake select * from {{source(...)}} where {{filter_partition_and_limit_ci()}} {%-

    macro filter_partition_and_limit_ci(rows_limit=10) -%} {%- if target.name == "ci" %} {{ filter_partition() }} {{ limit_ci(rows_limit) }} {%- else -%} 1 = 1 {%- endif -%} {%- endmacro -%} 発行されるSQLイメージ select * from hoge where 2025-02-26T04:00' <= _partition_hourly and _partition_hourly <= '2025-02-26T04:00' limit 10
  4. filter_partition @ dbt-snowflake {%- macro filter_partition() -%} {%- set transform_start_datehour

    = var("transform_start_datehour", default=none) -%} {%- set transform_end_datehour = var("transform_end_datehour", default=none) -%} {%- set start_partition = dbt.safe_cast( "'" ~ transform_start_datehour ~ "'", api.Column.translate_type("timestamp"), ) -%} {%- set end_partition = dbt.safe_cast( "'" ~ transform_end_datehour ~ "'", api.Column.translate_type("timestamp"), ) -%} {{ start_partition }} <= _partition_hourly and _partition_hourly <= {{ end_partition }} {%- endmacro -%}