dbt Fusion Documentation
repository·main·Indexed 20 days ago
https://github.com/dbt-labs/dbt-fusionA high-performance, Rust-based rewrite of the dbt execution engine featuring enhanced SQL comprehension and faster data transfers via ADBC drivers. The repository includes the dbt-ci crate for release pipeline management (PyPI and Homebrew), the dbt-cloud-api crate for interacting with dbt Cloud API v3, and a custom tracing infrastructure for performance visualization via Jaeger and OTLP.
What's inside dbt-fusion
- MiniJinja-Contrib is a utility crate designed to extend MiniJinja. It provides specialized utilities and functionality that are too specific to be included in the MiniJinja core, often providing features that are not present in standard Jinja2 but are useful for specific implementations.
Overview of dbt-csv
mainThedbt-csvcrate is a CSV reader designed to be 100% conformant with dbt Core's CSV parsing behavior. While dbt Core uses Python'sagatelibrary to parse CSVs into Python-typed values,dbt-csvreplicates this logic in Rust. It produces a stream of ArrowRecordBatchobjects with types that match what dbt Core would produce, ensuring consistent behavior across the dbt ecosystem.Overview of dbt Core v2.0 (Alpha)
maindbt Core v2.0 is a major rewrite powered by the Rust engine (previously known as Fusion). It aims to provide a single, unified foundation for the dbt framework.
Key features include:
- Performance: A fast Rust-based engine designed for scale.
- Strict Specification: A codified language spec that eliminates silent configuration errors.
- New Artifacts: Parquet metadata artifacts designed for speed and scale, powering a refreshed
dbt-docsexperience. - Unified Foundation: A single engine and adapter layer replacing the previous bifurcated model.
What is MiniJinja-Embed
mainMiniJinja-Embed is a utility crate for the MiniJinja template engine. It provides two primary capabilities for developers:
- Template Embedding: It provides utility macros to embed templates directly into your compiled binary.
- Iterative Development Support: It supports using a loader during development, allowing you to iterate on templates without needing to recompile the binary every time a change is made.
dbt Core 2022 Roadmap Overview
mainThis document outlines the strategic development goals for dbt Core throughout 2022. The roadmap focuses on three primary pillars:
- New Constructs: Moving beyond SQL/Jinja-SQL constraints to make complex tasks easier and introduce new ways to interact with dbt.
- Modular Interfaces: Refactoring the codebase to decouple tasks, configurations, and CLI initialization, enabling better long-term development and third-party integrations.
- Stability and Compatibility: Maintaining the commitments of dbt Core as major-version-one software, specifically regarding backwards compatibility and ease of upgrades.
Release Schedule
New minor versions of dbt Core and its official adapters are released every three months:
- April
- July
- August
- January (following year)
For each minor version, a migration guide is provided in the official documentation.
Explore dbt Cloud API models
mainThe
dbt-cloud-apicrate provides a comprehensive set of Rust models that map to the dbt Cloud API. These models cover various domains including:- Account & Users:
AccountUser,AccountResponse,User,AccountScopedPatResponse. - Connections & Adapters:
BigqueryConnection,SnowflakeConnection,PostgresConnection,DbtAdapter,AdapterMetadata. - Projects & Environments:
Project,EnvironmentV3,RepositoryV3. - Security & Access:
ServiceToken,ScimConfig,IpRestrictionRule,GroupPermission. - Jobs & Automation:
JobDefinitionV2,JobTypeEnum. - Webhooks & Audit:
WebhookResponseStatus,AuditLogBulkExportStatusResponse.
Detailed documentation for each specific model is available in the
docs/directory of the crate.- Account & Users:
Locate adapter macros for dbt_macro_assets
mainThe
dbt_macro_assetscomponent relies on adapter macros that are maintained in external repositories rather than within this specific crate. If you need to find or contribute to the macros used for specific adapters, refer to the following locations:- dbt-adapters: dbt-labs/dbt-adapters
- dbt-databricks: databricks/dbt-databricks
Use dbt-ci release-pipeline commands
mainThe
dbt-cicrate provides commands for managing the release pipeline of dbt-fusion. These commands are exposed via acargo cialias in the workspace configuration. They handle version bumping, PyPI packaging/publishing, and Homebrew formula rendering/publishing.# Commands are invoked via the cargo ci alias cargo ci <subcommand> [options]Understand the dbt Core roadmap and versioning strategy
maindbt Core follows a release cycle of approximately one minor version per quarter. The roadmap includes planned features with varying confidence levels. Key historical and upcoming milestones include:
- v1.1: Introduced testing frameworks for dbt-core and adapters.
- v1.2: Added built-in support for grants and improvements to metrics.
- v1.3: Introduces support for Python models and improvements to metrics for the dbt Semantic Layer. Also includes an upgrade to Jinja3.
- v1.4: Focuses on technical interfaces, including a documented Python API/library and improved CLI.
- v1.5+: Focuses on multi-project deployments and external orchestration.
Use Docker containers for isolated testing
mainThedbt-test-containersdirectory provides Dockerfiles designed to run tests in isolated environments. These images are specifically used by tests such astest_dbt_compile, which utilizesdbt/Dockerfileto execute dbt commands within an isolated Python environment. This ensures that test execution does not interfere with the host system's dependencies.Use dbt-tui-progress for terminal progress bars
mainThe
dbt-tui-progresscrate provides a thread-safe, type-safe terminal progress bar controller for TUI (Terminal User Interface) layers. It wrapsindicatifto manage multiple progress bars and spinners using a generic, hashable ID type. This allows you to decouple the identity of a task from its display text.Key features include:
- Generic ID type: Identify progress bars with any type that implements
Hash + Eq. - Thread-safety: Uses
scc::HashMapfor concurrent access. - Background animations: A dedicated ticker thread handles animations.
- Suspension support: Provides a mechanism to interleave log output with progress bars without corrupting the terminal display.
use dbt_tui_progress::ProgressController; #[derive(Debug, Clone, Hash, Eq, PartialEq)] enum Phase { Render, Run, } let mut ctrl = ProgressController::<Phase>::new(); ctrl.start_ticker(); // Start a progress bar ctrl.start_bar(Phase::Render, 100, "Rendering"); // Track in-progress items ctrl.add_bar_context(&Phase::Render, "model_a"); ctrl.finish_bar_context(&Phase::Render, "model_a", Some("succeeded")); // Suspend for log output ctrl.with_suspended(|| { println!("Log message"); }); // Clean up ctrl.remove_bar(&Phase::Render);- Generic ID type: Identify progress bars with any type that implements
How Fusion's tracing infrastructure works
mainFusion uses a custom tracing architecture built on top of the native
tracingcrate to overcome limitations like lack of thread-safe event storage and restricted access to structured data during filtering.The data flows through four main stages:
- Application Code: Uses standard
tracingmacros (e.g.,instrument,create_info_span!). - TelemetryDataLayer: A native
tracingLayer that converts spans/events into structured records, generates unique IDs, and injects code location/context. - Middleware Pipeline: Uses
TelemetryMiddlewareto transform, modify, or drop spans/logs. It has mutable access to metrics viaDataProviderMut. - Consumer Layers: Uses
TelemetryConsumerto process data in a read-only fashion (e.g., writing to JSONL, Parquet, or exporting via OTLP).
- Application Code: Uses standard