カナダ大手鉄道、Genie Code でデータパイプラインを大規模化
本文の状態
日本語全文を表示中
詳細モードで約14分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Databricks AI Engineering
同社は Databricks Genie Code を用いて YAML プロンプトだけで、表定義やストリーミング取り込みロジックを含む本番環境対応コードを自動生成する仕組みを構築した。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るAI深層分析を開く2026年8月13日 04:27
AI深層分析
キーポイント
Genie Code によるパイプライン自動生成の実現
同社は Databricks Genie Code を用いて YAML プロンプトだけで、表定義やストリーミング取り込みロジックを含む本番環境対応コードを自動生成する仕組みを構築した。
開発期間の劇的な短縮と自動化率の高さ
単一テーブルのパイプライン構築に要していた数日間という工数が、自動化により数分に圧縮され、新テーブル取り込みにおける自動化率は 90% を超えた。
レガシーシステムからの大規模移行戦略
数十年かけて構築されたメインフレームやレガシーデータウェアハウスを基盤に、ビジネスロジックを維持しつつ湖家アーキテクチャへの移行を数百本のパイプラインで並行して実施した。
カスタムスキルと Unity Catalog の活用
同社は Databricks Apps で構築した Streamlit アプリや、生のカスタムエージェントスキル、Unity Catalog を組み合わせることで、企業標準に準拠した一貫性のある開発を可能にした。
Databricks を基盤としたモダナイゼーションの仕組み
Genie Code とカスタムエージェントスキル、および Databricks App を組み合わせることで、メタデータ発見からコード生成までのエンドツーエンドワークフローを実現した。
重要な引用
The result is more than 90% automation for new table ingestion, pipeline delivery compressed from days to minutes
A short YAML prompt can now generate production-ready ingestion code grounded in live catalog metadata and aligned to enterprise conventions by default
Adding determinism to a probabilistic workflow is the key. We chose to automate what we know is correct, and we leave the interpretation layer optional. The LLM helps as you think. The framework ensures explainability is built in.
Instead of documenting standards in one place and asking every developer to interpret them manually, the team encoded those standards into the workflow itself.
編集コメントを表示
編集コメント
レガシーシステムを抱える大規模企業におけるデータ近代化の課題に対し、Genie Code が具体的な解決策を提供する事例は非常に示唆に富んでいる。開発プロセスそのものを自動化工場として再構築した手法は、同業他社にとっても重要な参考となるだろう。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
カナダ最大級の鉄道ネットワークの一つは、全長約 20,000 マイルに及び、カナダ国内から米国へと延びています。年間 C$2500 億ドル以上の貨物輸送を支えるこの巨大組織にとって、数十年にわたるデータ資産の近代化を、テーブル単位で地道に進めるような作業では到底間に合いません。
運用中のパイプラインが数百本あり、リアルタイム分析や AI への需要が高まる中、レガシーシステムには深い組織的な知見が蓄積されていました。そこで必要とされたのは、手動開発の負荷を増やすことなく近代化をスケールさせる方法でした。
Databricks の Genie Code、Unity Catalog、カスタム Agent Skills、そして Databricks Apps を基盤に構築した Streamlit アプリを活用し、チームはパイプライン開発そのものを反復可能な工場へと変貌させました。短い YAML プロンプトを入力するだけで、カタログの生データに基づき、デフォルトで企業基準に準拠した本番環境用の取り込みコードを生成できます。これにはテーブル定義、履歴データの読み込みロジック、ストリーミング取り込みロジック、増分マージロジック、そして自動テストが含まれます。
その結果、新しいテーブルの取り込みにおける自動化率は 90% を超え、パイプラインの納期は数日から数分に短縮されました。開発者のリソースに制約されることなく、ビジネスの成長に合わせて拡張可能な近代化プログラムが実現したのです。
エンタープライズ規模で複雑なデータ資産を近代化する
多くの大企業と同様に、この会社も長年にわたりメインフレームシステム、レガシーデータウェアハウス、エンタープライズ ETL プラットフォーム、専用アプライアンスなどを中心に分析基盤を構築してきました。モダンなレイクハウスアーキテクチャへの移行を進める中で直面した課題は、単なるデータ移行だけではありませんでした。広大なレガシー資産に埋め込まれた重要なビジネスロジックを維持しつつ、パイプラインの作成プロセスそのものを簡素化し標準化する必要があったのです。
自動化以前、単一のテーブルに対してパイプラインを構築するには数日間の作業が必要でした。チームはソーススキーマを検証し、Source-to-Target Mapping スプレッドシート上でビジネスロジックを定義し、履歴データとストリーミングデータの取り込みロジックを実装し、増分マージパイプラインを作成し、下流のトランスフォーメーションを実行する必要があります。さらに、スキーマ進化やカラム名変更、型変換、ソフトデリートといったケースに対するテストカバレッジも用意しなければなりませんでした。
この作業はテーブルが 1 つだけなら管理可能でしたが、数百に及ぶテーブルでは到底不可能でした。真のボトルネックは、レガシーロジックをレイクハウス用パイプラインへ繰り返し、かつ一貫性を持って変換するために必要な手作業の量でした。
同社は単にパイプラインを近代化するだけでなく、数百ものパイプラインを作成するプロセスそのものを刷新する必要がありました。
モダン化のエンジンとしての Databricks
このソリューションは、2 つの機能が連携することで実現されました。1 つ目は、Genie Code にカスタムエージェントスキルを組み合わせ、本番環境で即座に使用可能なデータ取り込みアーティファクトを生成する機能です。2 つ目は、Databricks App を活用してソース側のフィールドをターゲットのレイクハウステーブルにマッピングし、変換ロジックを自動生成する機能です。
これらにより、メタデータの発見からコード生成に至るまでのエンドツーエンドのワークフローが、すべて Databricks 上で構築されました。Genie Code は自律的な AI パートナーとして機能し、カスタムエージェントスキルには同社のデータ取り込みパターンやマージロジックが組み込まれています。また、Unity Catalog を用いて、生データ層、履歴層、前処理層全体にわたるスキーマの内部構造を把握可能にし、Databricks App がソースからターゲットへのマッピング体験を支えます。生成されたパイプラインは PySpark、Spark SQL、Delta Lake を採用し、Lakeflow Jobs 上で実行されるように設計されています。
このアプローチにより、チームは Genie Code に独自の取り込み基準やパイプラインの慣習を拡張して適用することが可能になりました。監査の規約、重複排除ロジック、変更シーケンスによるマージガード、ソフトデリートとの整合性調整、テストパターンなどは、すべての開発者が手動で適用するのではなく、生成プロセスそのものに埋め込まれています。
確率的なワークフローに決定論的要素を加えることが鍵となります。私たちは「正しいと分かっていること」を自動化し、解釈の層は任意のものとして残しました。LLM は思考の過程をサポートしますが、フレームワークが説明可能性を内蔵しています。—Dinesh Chandrasekaran 氏(カナダ大手運輸・物流企業のデータ & AI リーダー)
この哲学が全体の基盤となりました。推論や発見が重要な場面では AI を活用し、一貫性と再現性が最優先される場面では厳格なパターンを採用するのです。
短いプロンプトから本番環境対応のパイプラインへ
開発者はコンパクトな YAML プロンプトから始めます。最もシンプルなケースでは、生データ取り込み用として 2 行のプロンプトだけで済みます。一方、完全なテーブルパイプラインを構築する場合は、ソースとターゲットのテーブル名、主キー、重複排除ロジック、更新処理といったコア入力項目が含まれます。
ここから Genie Code が構造化されたワークフローを実行します。まずプロンプトを解析・検証し、Unity Catalog のメタデータを通じて過去の信頼できるレイヤースキーマを検出します。その後、ソースとのカラム自動マッチングを行い、型変換やリネームの要件を特定。さらに変換パターンを解決し、社内の標準パターンに従って必要なアーティファクトを生成。最後に、必須の企業規定に照らして各出力を検証します。この企業規定には、主キーのカバー率、監査用カラムの配置、変更シーケンス保護付きマージ、REFRESH 対応の重複排除、テストスイートのカバレッジなどが含まれます。
モードに応じて、ワークフローは単一テーブル処理、1 つのリクエストでの複数テーブル処理、あるいは Unity Catalog ボリュームに保存された CSV または Excel ファイルで駆動される一括実行をサポートします。実際の運用では、以下の 6 つの本番環境対応出力を生成できます。DDL(データ定義言語)、履歴データロード、生ストリーミング取り込み、初回インクリメンタルマージ、継続的なインクリメンタルマージ、そして自動テストスイートです。
生成されるノートブックはすべて、監査用列、重複排除、変更シーケンス対応の結合、ソフト削除整合性といった企業標準に則って作成されます。
エージェントスキルで企業標準を再利用可能に
このアーキテクチャの鍵となるのが、カスタム「Agent Skill」です。これにより Genie Code は、同社のデータ取り込み基準や命名規則、パイプラインパターンを一貫して適用できる仕組みを得ています。
このスキルは他のコードベースと同様にバージョン管理されます。カタログ検索、命名規則、生データの取り込み、履歴データのロード、増分結合、テスト生成といった各工程に対応する SKILL.md エントリーポイントと、関連するパターンファイル群が含まれています。この構造により、企業側では生成ロジックを一元管理しつつ、開発者は Genie Code を通じてその機能を利用できます。
スキルは単一のフォルダとして workspace/.assistant/skills/lakehouse-ingestion/ にアップロードされます。
ここには SKILL.md エントリーポイントに加え、各アーティファクトタイプごとの 7 つのパターンファイルが格納されています。
Genie Code がこのスキルをいつ読み込むかを決定するのは、SKILL.md のフロントマター部分です。
企業標準を一つの場所にまとめて文書化し、開発者一人ひとりに解釈させるのではなく、チームはこれらの基準をワークフローそのものに組み込みました。エージェントがコンテキストの収集と調整を担当し、スキルが発生するアーティファクトが常に同じパターンに従うことを保証します。
開発者は Genie Code セッション内で短い YAML プロンプトを入力することでコード生成を開始します。生データの取り込みのみであれば 2 行で十分ですが、完全なパイプラインを構築するには 6 行が必要です。
最小限の例では、生データの取り込み用ノートブックのみが生成されます。
完全な例では、1 つのテーブルに対して 6 つのアートファクトからなるパイプライン全体が生成されます。
これら 6 つのアートファクトは、実行時に以下の順序で動作します。
Unity Catalog に根ざし、デフォルトでガバナンスされる
もう一つの重要な設計原則は、コード生成を静的な仮定ではなく、生きたメタデータに基づいて行うことです。
Genie Code は Unity Catalog を活用して、生のテーブルや履歴テーブル、前処理済みのテーブルにわたるスキーマをリアルタイムで確認します。このメタデータ駆動型のアプローチにより、別個の発見レイヤーが必要なくなるだけでなく、コード生成前に必要なコンテキストがエージェントに提供されます。これにより、マッピングの生成、変換の推論、必須フィールドの検証が可能になります。
同様に重要なのは、生成されたすべてのアートファクトが Databricks ワークスペース内に留まり、データプラットフォーム全体のガバナンスモデルと同じ枠組みで動作することです。アクセス制御、メタデータポリシー、改訂履歴はすべて Databricks ネイティブのまま維持されます。この「メタデータへの根ざし」と「ガバナンスされた実行」の組み合わせにより、チームは企業における AI 導入の一般的な課題を解決しました。つまり、一貫性を損なったり制御を弱めたりすることなく、スピードを向上させたのです。
重要な場面では人間の関与(ヒューマン・イン・ザ・ループ)を実現
同社はこれを完全に自動化された生成問題として扱いませんでした。コード生成の前段階で、データデザイナーは Databricks のアプリを使用して、レガシーなソースシステムからのフィールドが、ターゲットのレイクハウステーブルにどのようにマッピングされるべきかを確認します。
このステップは「ソースからターゲットへのマッピング」と呼ばれ、推測や盲目的な自動化では扱えないべきビジネスロジックを捉えるものです。Streamlit をベースにした Databricks Apps で構築されたこのアプリは、ソースシステムのテーブルをスキャンし、カラムのマッピングを事前に埋め込んだ上で、データデザイナーがブラウザ上で変換ロジックのレビューと微調整を行えるようにします。
すべての編集内容は変更ログに記録され、最終的なマッピングはエクスポートして生成ワークフローの入力として利用できます。これにより、ビジネス解釈が依然として重要な工程における専門家によるレビューを排除することなく、プロセスを高速化しました。データデザイナーは変換の意図とビジネスロジックに集中でき、Genie Code と生成フレームワークが反復的な実装パターンを担当します。
設計上から決定論的であること
アーキテクチャにおける最も重要な判断の一つは、推論層を知的で適応性のあるものとしつつ、出力されるパイプラインコードを決定論的に保つことにありました。
Genie Code は、プロンプトの解釈、スキーマの発見、適切な生成パスの選択、そして正しいアクションシーケンスの結合など、エージェントによる推論が効果を発揮するワークフロー部分を担当します。しかし、生成される PySpark コード自体はルール駆動型で再現可能です。マージ文、重複削除ウィンドウ、監査用カラムの配置、型キャスト、テストパターンなどは、すべて明示的なテンプレートと不変条件を通じて定義されています。
同社にとって、これは不可欠な要素でした。本番環境でのパイプライン生成において、マージロジックのわずかな違いや重複排除ウィンドウ、監査用カラムの配置が異なると、下流のデータ品質にリスクが生じます。決定論的な出力により、システムは企業規模で利用可能な信頼性を備え、苦労して築き上げたエンジニアリング基準を維持できる一貫性も得られました。
結果:開発者のスループットから近代化のスループットへ
その影響は即座に、かつ実用的な形で現れました。
- Databricks Lakehouse への新規テーブル取り込みの自動化率が90%以上
- テーブルごとのパイプライン開発時間が「数日」から「数分」に短縮
- 臨時リクエスト、バッチ処理による移行、スプリント規模の近代化プロジェクトなど、あらゆるケースに対応する単一、複数、一括生成モードをサポート
- 手動でのコンプライアンスレビューを必要とせず、生成されたすべての成果物に一貫して企業基準が適用される
変化したのは開発者の生産性だけではありません。同社は近代化プログラム自体のスループットも向上させました。
各テーブルの移行を個別のエンジニアリングプロジェクトとして扱うのではなく、チームはレガシー資産を統制されたLakehouseパイプラインに変換する反復可能なシステムを構築しました。
今後の展望
同社は、この取り組みをより広範なモダナイゼーション自動化の基盤と捉えています。現在、チームはオーケストレーション、変換、ビジネスロジック、観測機能のためのよりモジュール型のスキルアーキテクチャを検討中であり、Unity Catalog だけでなく企業全体のデータカタログまで発見範囲を広げようとしています。
また、従来の DataStage や COBOL、そして stored-procedure のロジックを PySpark へ AI が支援して変換する可能性も評価しています。さらに、最近登場したバックグラウンドエージェントの機能を活用し、パイプラインのトリアージ、DBR アップグレード、スキーマの不整合修正といった日常的なタスクをサポートすることを目指しています。
長期的な目標は、単にコード生成を高速化することだけではありません。レガシーシステムの複雑さやビジネス需要、プラットフォームの規模が拡大し続ける中でも、継続的にスケール可能なモダナイゼーションモデルを構築することです。
原文を表示
One of Canada’s largest railway networks spans roughly 20,000 route miles across Canada and into the United States, supporting the movement of more than C$250 billion in goods annually. For an organization operating at that scale, modernizing a decades-old data estate was never going to be a one-table-at-a-time exercise.
With hundreds of pipelines in flight, growing demand for real-time analytics and AI, and deep institutional knowledge embedded in legacy systems, the company needed a way to scale modernization without scaling manual development effort.
Using Databricks Genie Code, Unity Catalog, custom Agent Skills and a Streamlit app built on Databricks Apps, the team turned pipeline development itself into a repeatable factory. A short YAML prompt can now generate production-ready ingestion code grounded in live catalog metadata and aligned to enterprise conventions by default, including table definitions, historical load logic, streaming ingestion logic, incremental merge logic and automated tests.
The result is more than 90% automation for new table ingestion, pipeline delivery compressed from days to minutes, and a modernization program that can scale with the business instead of being constrained by developer bandwidth.
Modernizing a complex data estate at enterprise scale
Like many large enterprises, the company built its analytical estate over decades across mainframe systems, legacy data warehouses, enterprise ETL platforms and purpose-built appliances. As the company moved toward a modern lakehouse architecture, the challenge was bigger than migration alone: the team needed to simplify and standardize how pipelines were built while preserving critical business logic across a large legacy footprint.
Before automation, building a pipeline for a single table was a multi-day effort. Teams had to inspect source schemas, define business logic in a Source-to-Target Mapping spreadsheet, build historical and streaming ingestion logic, write incremental merge pipelines, implement downstream transformations and create test coverage for cases like schema evolution, column renames, type casts and soft deletes.
That work was manageable for one table; it was not manageable for hundreds. The real constraint was the manual effort required to translate legacy logic into lakehouse pipelines repeatedly and consistently.
The company needed to modernize not just its pipelines, but the process of building hundreds of pipelines.
Databricks as the modernization engine
The solution centered on two capabilities working together: Genie Code with custom Agent Skills to generate production-ready ingestion artifacts, and a Databricks App for mapping source fields to target lakehouse tables and generating transformation logic.
Together, they created an end-to-end workflow from metadata discovery to generated code, all within Databricks. Genie Code serves as the autonomous AI partner, while a custom Agent Skill encodes the company’s ingestion patterns and merge logic. Unity Catalog provides schema introspection across raw, historical, and prep layers, while Databricks Apps supports the source-to-target mapping experience. The resulting pipelines use PySpark, Spark SQL, and Delta Lake and are designed to run through Lakeflow Jobs.
This approach allowed the team to extend Genie Code with its own ingestion standards and pipeline conventions. Audit conventions, deduplication logic, change-sequence merge guards, soft-delete reconciliation, and test patterns are embedded directly into the generation process rather than relying on every developer to apply them manually.
Adding determinism to a probabilistic workflow is the key. We chose to automate what we know is correct, and we leave the interpretation layer optional. The LLM helps as you think. The framework ensures explainability is built in.—Dinesh Chandrasekaran, Data & AI Leader at a Leading Canadian Transportation & Logistics Company
That philosophy became central to the entire approach: use AI where reasoning and discovery matter, and use strict patterns where consistency and reproducibility matter most.
From a short prompt to production-ready pipelines
A developer begins with a compact YAML prompt. In the simplest case, that prompt can be as small as two lines for raw ingestion. For a full table pipeline, it includes core inputs such as source and target table names, primary keys, deduplication logic and refresh behavior.
From there, Genie Code follows a structured workflow. It parses and validates the prompt, discovers historical and trusted layer schemas through Unity Catalog metadata, auto-matches columns with source, identifies type-cast and rename requirements, resolves transformation patterns, generates the requested artifacts using the company’s standard patterns and validates each output against required enterprise invariants. Those invariants include primary-key coverage, audit-column placement, change-sequence-guarded merges, REFRESH-aware deduplication and test-suite coverage.
Depending on the mode, the workflow supports a single table, multiple tables in one request or a bulk run driven by a CSV or Excel file stored in a Unity Catalog volume. In practice, the workflow can generate six production-ready outputs: DDL, historical load, raw streaming ingestion, first incremental merge, ongoing incremental merge and an automated test suite.
Every generated notebook follows the same enterprise conventions for audit columns, deduplication, change-sequence-aware merges and soft-delete reconciliation.
Agent Skills made enterprise standards reusable
A key part of the architecture was the custom Agent Skill, which gives Genie Code a reusable way to apply the company’s ingestion standards, naming conventions, and pipeline patterns.
The skill is versioned like any other codebase. It includes a SKILL.md entry point and supporting pattern files for catalog discovery, conventions, raw ingestion, historical loads, incremental merges and test generation. That structure lets the company maintain its generation logic centrally while making it available to developers through Genie Code.
The skill is a single folder uploaded to workspace/.assistant/skills/lakehouse-ingestion/.
It contains a SKILL.md entry point plus seven pattern files, one per artifact type:
The SKILL.md frontmatter is what Genie Code uses to decide when to load the skill:
Instead of documenting standards in one place and asking every developer to interpret them manually, the team encoded those standards into the workflow itself. The agent handles the context gathering and orchestration. The skill ensures the generated artifacts follow the same patterns every time.
A developer starts code generation with a short YAML prompt inside a Genie Code session. The minimum is two lines for raw ingestion only. A full pipeline takes six.
Minimal example, generates only the raw ingestion notebook:
Full example, generates the complete six-artifact pipeline for one table:
The six artifacts execute in this order at runtime:
Grounded in Unity Catalog, governed by default
Another key design principle was grounding code generation in live metadata rather than static assumptions.
Genie Code uses Unity Catalog to inspect schemas across raw, historical and prep tables in real time. That metadata-driven approach eliminates the need for a separate discovery layer and gives the agent the context it needs to generate mappings, infer transformations and validate required fields before code is emitted.
Just as important, all generated artifacts remain inside the Databricks workspace and operate within the same governance model as the rest of the data platform. Access controls, metadata policies and revision history remain native to Databricks. That combination of metadata grounding and governed execution helped the team close a common gap in enterprise AI adoption: moving faster without introducing inconsistency or weakening controls.
Human-in-the-loop where it matters
The company did not treat this as a fully hands-off generation problem. Before code is generated, data designers use a databricks app to inspect how fields from legacy source systems should map to target lakehouse tables.
This step, called Source-to-Target Mapping, captures business logic that should not be guessed or automated blindly. Built with Streamlit based Databricks Apps, the app scans source-system tables, prepopulates column mappings and lets data designers review and refine transformation logic in the browser.
Each edit is tracked in a change log, and the final mapping can be exported and used as input for the generation workflow. This made the process faster without removing expert review from the parts of the workflow where business interpretation still matters. Data designers could focus on transformation intent and business logic, while Genie Code and the generation framework handled repeatable implementation patterns.
Deterministic by design
One of the most important decisions in the architecture was to keep the reasoning layer intelligent and adaptive while making the emitted pipeline code deterministic.
Genie Code handles the parts of the workflow that benefit from agentic reasoning: interpreting prompts, discovering schemas, selecting the right generation path and stitching together the correct sequence of actions. But the generated PySpark code itself is rule-driven and reproducible. Merge statements, deduplication windows, audit-column placement, type casts and test patterns are all defined through explicit templates and invariants.
For the company, that was essential. In production pipeline generation, small variations in merge logic, deduplication windows or audit-column placement can create downstream data quality risk. Deterministic emission made the system trustworthy enough to use at enterprise scale and consistent enough to preserve hard-won engineering standards.
Results: from developer throughput to modernization throughput
The impact was immediate and practical:
- More than 90% automation for new table ingestion into the Databricks Lakehouse
- Pipeline development time reduced from days per table to minutes
- Support for single, multiple and bulk generation modes across ad hoc requests, batched migrations and sprint-scale modernization efforts
- Consistent application enterprise standards across every generated artifact, without requiring manual compliance review
What changed was not only developer productivity. The company increased the throughput of the modernization program itself.
Instead of treating every table migration as a bespoke engineering project, the team created a repeatable system for translating legacy assets into governed lakehouse pipelines at scale.
Looking ahead
The company sees this as the foundation for broader modernization automation. The team is now exploring a more modular skill architecture for orchestration, transformation, business logic and observability; extending discovery beyond Unity Catalog into the broader enterprise data catalog; evaluating AI-assisted conversion of legacy DataStage, COBOL and stored-procedure logic to PySpark; and using emerging background-agent capabilities to support routine pipeline triage, DBR upgrades and schema-mismatch repair.
The long-term goal goes beyond faster code generation. It is to create a modernization model that scales continuously, even as legacy complexity, business demand and platform scope continue to grow.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み