[BUG] `fab table schema` failure
まだ誰も着手していません。
評価
調査の方向性
fab table schema コマンドから始めて、保持されている _delta_log/*.json ファイルを列挙し、metaData.schemaString を抽出する処理を追跡します。その経路を、issue で説明されている checkpoint Parquet ファイルの場合と比較し、その後、メタデータ JSON が削除されたテーブルでの動作を確認します。完了条件は、そのコマンドが有効な Delta テーブルの現在のスキーマを InvalidDeltaTable ではなく返すことです。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
Docs claim that fab table schema has full support for Lakehouse tables:
https://microsoft.github.io/fabric-cli/commands/tables/#:~:text=.-,Lakehouse,-(full%20support)
However, the table schema command can fail for a valid Delta table when the original Delta transaction-log JSON file containing the metaData action has already been removed by Delta log retention/checkpointing.
I have two tables in the same Lakehouse:
table_a—fab table schemaworks correctly.table_b—fab table schemareturnsInvalidDeltaTable.
Both tables are valid Delta tables and are accessible from Fabric/Spark.
The relevant difference appears to be their _delta_log history:
- The working table still contains the initial
00000000000000000000.jsonfile, which contains ametaDataobject withschemaStringobject inside. - The failing table has older JSON transaction logs removed and the currently retained JSON files start around version
00000000000000000260.json. None of the retained JSON files contain ametaDataobject. The older table state is represented through Delta checkpoint files.
Based on the current Fabric CLI implementation, fab table schema scans JSON files inside _delta_log and searches for a metaData.schemaString. It does not appear to reconstruct the Delta metadata from checkpoint Parquet files. As a result, a valid Delta table can incorrectly produce an InvalidDeltaTable error.
fabric-cli version
1.6.1
Python version
3.11.9
Operating System
Windows
CLI Mode
Command line mode
Authentication Method
Interactive browser login
Steps to Reproduce
- Create a Lakehouse containing a Delta table.
- Allow the table to accumulate enough Delta transaction history for older JSON log files containing the original
metaDataaction to be removed according to Delta log retention/checkpointing. - Verify that the table remains a valid Delta table and can be queried normally from Fabric/Spark.
- Verify that the remaining
_delta_log/*.jsonfiles do not contain ametaDataaction, while checkpoint files exist. - Run:
fab table schema testworkspace.Workspace/testlakehouse.Lakehouse/Tables/dbo/problem_table
The command returns:
[InvalidDeltaTable] Failed to extract the table schema. Please ensure the path points to a valid Delta table
For comparison, running the same command against another table in the same Lakehouse whose _delta_log still contains the original metadata JSON works correctly:
fab table schema testworkspace.Workspace/testlakehouse.Lakehouse/Tables/dbo/working_table
Expected Behavior
fab table schema should return the schema for any valid supported Delta table regardless of whether the original JSON transaction-log file containing the metaData action is still retained.
Delta tables remain valid after checkpointing and transaction-log retention, so schema extraction should work from the current Delta snapshot rather than depend on historical JSON files being present.
Actual Behavior
fab table schema returns:
[InvalidDeltaTable] Failed to extract the table schema. Please ensure the path points to a valid Delta table
even though the table itself is a valid Delta table.
The command succeeds for another table in the same Lakehouse where a retained _delta_log/*.json file still contains a metaData object.
Additional Context
Looking at the current fabric-cli implementation of table schema, the command appears to:
- Open
<table>/_delta_log. - Enumerate
.jsontransaction-log files. - Read those JSON files in reverse order.
- Search for a
metaDataaction. - Extract
metaData.schemaString. - Return
InvalidDeltaTableif no such JSON action is found.
This approach does not seem to account for Delta checkpoints.
In the failing table, the oldest retained JSON transaction-log file is approximately:
00000000000000000260.json
and none of the currently retained JSON files contain a metaData action.
The working table still has:
00000000000000000000.json
which contains the expected metaData.schemaString.
This makes the behavior dependent on Delta transaction-log retention/history rather than on whether the table is actually a valid Delta table.
Possible Solution
Instead of deriving the schema only by searching retained _delta_log/*.json files for a metaData action, fab table schema could reconstruct the current Delta snapshot, including metadata from checkpoint Parquet files.
Alternatively, the implementation could use a Delta-aware API/library or another Fabric metadata endpoint capable of returning the current table schema independently of transaction-log retention.
The InvalidDeltaTable error should also ideally be reserved for genuinely invalid/non-Delta tables. If schema extraction fails because the required metadata is unavailable through the current CLI implementation, a more specific error would make troubleshooting easier.
- 主要言語
- Python
- スター
- 178
- フォーク
- 65
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/fabric-cli のほかの issue
-
[FEATURE] Loosen strict dependency pins to improve compatibility with newer `fabric-cicd` versions再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンai:feature-triage:unable-to-process enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
microsoft/fabric-cli#294 · コメント 3 件 · リアクション 1 件 ·
-
[BUG] bulk-export errors with "[NotSupported] Only supported for Lakehouse/Files"再び着手できるかも @rksharma-owg が 46 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンai:bug-triage:unable-to-process bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/fabric-cli#287 · コメント 2 件 ·
-
ai:feature-triage:unable-to-process enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
microsoft/fabric-cli#292 · コメント 1 件 ·
-
ai:question-triage:unable-to-process question
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
microsoft/fabric-cli#288 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/fabric-cli#286 · コメント 3 件 ·
microsoft/fabric-cli の issue をすべて見る
似ている issue
-
Context/namespace resources fail in-cluster: "Invalid kube-config file. No configuration found."オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
awslabs/visual-asset-management-system#880 ·
メンテナーはふだん 1 日以内に返信
-
netbox status: needs owner type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
netbox-community/netbox#23533 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
netbox-community/netbox-scripts#68 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
marin-community/marin#10765 ·
メンテナーはふだん 1 日以内に返信