persist_docs.columns triggers a full-plan probe query on views even when the model has no column docs
メンテナーはふだん 6 日以内に返信
評価
調査の方向性
dbt/include/databricks/macros/relations/view/create.sql から始め、そのカラムドキュメント用 guard を macros/adapters/persist_docs.sql と比較します。schema.yml にカラムエントリがなく、persist_column_docs が有効になっているビュー model で再現します。model のカラムがない場合に full-plan probe query が実行されず、ドキュメント化されたカラムは引き続き persist されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
With persist_docs: {columns: true}, databricks__create_view_as always calls get_columns_in_query(sql) before creating a view, which executes select * from (<full model sql>) as __dbt_sbq where false limit 0 against the warehouse. It does this even when the model has no columns: entries in any schema YAML, in which case the resulting column list contains no comment clauses and is semantically identical to emitting no column list at all.
On a wide view the probe hangs for a long time. where false is only folded after full analysis, so Spark still plans the whole query and does Delta metadata/file listing on every source.
Expected behavior
No probe query when the model has no column descriptions. dbt's own macros/adapters/persist_docs.sql already uses this guard:
{% if for_columns and config.persist_column_docs() and model.columns %}
The Databricks view path omits the and model.columns short-circuit.
Suggested fix
In dbt/include/databricks/macros/relations/view/create.sql:
{%- if config.persist_column_docs() and model.columns -%}
Steps to reproduce
- Set
persist_docs: {relation: true, columns: true}indbt_project.yml - Create a
materialized='view'model with no correspondingschema.ymlentry - Run
dbt run -s that_modeland observe thewhere false limit 0query in the Databricks query history
Notes
- Workaround:
persist_docs={'relation': True, 'columns': False}per model.
System information
- dbt-databricks: 1.11.6
- dbt-core: 1.11.6
- databricks-sql-connector: 4.1.3
- 主要言語
- Python
- スター
- 391
- フォーク
- 231
- 平均マージ
- 9日 7時間
- マージ済み PR(30日)
- 29
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databricks/dbt-databricks のほかの issue
-
bug
難易度 2/5 半日 初心者へのやさしさ 68/100
databricks/dbt-databricks#1003 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
Emit COMMENT and DEFAULT for function arguments and descriptions in CREATE FUNCTION対応中かも @alvinism が 7 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
databricks/dbt-databricks#1764 ·
メンテナーはふだん 6 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 46/100
databricks/dbt-databricks#1762 ·
メンテナーはふだん 6 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
databricks/dbt-databricks#1761 ·
メンテナーはふだん 6 日以内に返信
-
Metadata queries break on catalog, schema or table names containing a quote or backslash対応中かも @MsMansiDhruv が 14 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
databricks/dbt-databricks#1747 ·
メンテナーはふだん 6 日以内に返信
databricks/dbt-databricks の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
FinanceFlash/unvibecode#699 ·
メンテナーはふだん 1 日以内に返信
-
enhancement Website
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OWASP/OWASP-Hunting#96 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
micropython/micropython#19942 ·
メンテナーはふだん 1 日以内に返信
-
A rebuild posts "not part of this build" success to the commit's failed `nix-build` gate and effects対応中かも @Padraic-O-Mhuiris が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`epoch.Integer` raises a raw OverflowError for integers too large to convert to a float対応中かも @arindam77 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pydantic/pydantic-extra-types#479 ·
メンテナーはふだん 1 日以内に返信