Run flow¶
hodor loads inside the dbt process. A Databricks dbt_task job needs every command to start with dbt, so a wrapper CLI is not an option.
Steps¶
- Plugin start. With mode
off, or for any command other thanrun,build,test,seedorsnapshot, hodor installs nothing. If upstreamdbt_stateis also installed, hodor turns itself off with a warning, because both patch the same methods. On any adapter other thandatabricksorduckdb, hodor is off with a warning. - Run start. hodor opens the store and loads the latest record of every node in one query. It reads the warehouse clock in epoch milliseconds, so
lag_tolerancedoes not depend on the local clock. It reads data versions in parallel, onhodor_metadata_threadsthreads. - Each model. dbt has already compiled the node. hodor builds the node facts and calls the engine.
- Reuse (mode
on): hodor returns dbt'sReusedstatus without calling the materialization. Hooks do not run unlessexecute_hooks_on_any_reuseistrue. - Build: hodor calls the original dbt code, then reads the table's new data version and queues a record.
- Reuse (mode
- Each test. Same flow. A replayed test returns its recorded status (pass, warn or fail) and failure count. The result line says
(replayed). - Records are queued in memory. They are written every 200 records and at the end of the run, also after errors and interrupts.
- Summary line.
dbt-hodor: N reused, M built, K fail-open errors.
Fail open¶
An exception anywhere in hodor for a node is logged as a warning, and the node builds as plain dbt would (reason hodor_error). See Operations.
Import cost¶
dbt imports every dbt_* module on every command, including ls and parse. import dbt_hodor therefore loads nothing heavy. sqlglot and duckdb load only when hodor is active for one of those commands.