Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Cached UC managed Delta table reads remain stale after RTAS or overwrite on Spark 4.0.1

オープン
#59,627 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
scala
領域
backend, databases

調査の方向性

Start by reading Spark 4.0.1's DataSourceV2Strategy and the cached-plan invalidation path, then compare the qualified-name invalidation change in PR #52599. Reproduce the RTAS and saveAsTable overwrite cases with the supplied Spark, Delta, and UC versions, checking whether cache invalidation matches the cached V1 LogicalRelation. Done means fresh reads return replacement rows and the dependent cached view is refreshed, with the append control still fresh.

索引モデルが issue の本文から書いたものです。

説明

We observed stale cached query results after successful replacement of a UC managed Delta table on Spark 4.0.1 with Delta 4.2.0 and OSS Unity Catalog 0.6.0. Both SQL REPLACE TABLE AS SELECT and DataFrameWriter.saveAsTable(mode="overwrite") are affected. The writes and reads occur in the same Spark session; this is not an external writer requiring explicit refresh.

Reproduction workflow

Precondition: a configured UC catalog supporting managed Delta tables, Java 17, and the matching Spark-line Delta/UC artifacts. Use independent tables for the two variants.

  1. Create a UC managed Delta table containing (1, 'original'), with delta.feature.catalogManaged=supported, deletion vectors disabled and CDF disabled.
  2. Cache the qualified table name and materialize its rows. For the RTAS variant, also cache and materialize a dependent temporary view.
  3. Replace the table with (2, 'replacement'), (3, 'replacement') through RTAS, or overwrite the independently seeded table with (3, 'overwritten') through saveAsTable.
  4. Read the qualified table name through a newly created query, without REFRESH TABLE, CLEAR CACHE or manual uncache.

Expected: the new query returns the replacement rows; the dependent cached view also reflects the replacement.

Actual on Spark 4.0.1: Delta history advances to version 1, but the fresh query still returns (1, 'original'). The dependent view in the RTAS variant is stale too. No persisted-data loss has been observed.

Verification
Spark Delta Execution RTAS saveAsTable overwrite Append control
4.0.1 4.2.0 local[4] Stale Stale Fresh
4.0.1 4.2.0 Standalone, separate driver/executor JVMs Stale Stale Fresh
4.1.1 4.2.0 local[4] Fresh Fresh Fresh

The Spark-line comparison uses the corresponding Delta and UC artifacts, not byte-identical dependencies.

Diagnosis and question

The cached analyzed plan contains a V1 LogicalRelation. Spark 4.0.1's DataSourceV2Strategy constructs a synthetic DataSourceV2Relation for invalidation; it does not match the cached plan (sameResult == false, cache lookup empty). Both writes execute AtomicReplaceTableAsSelectExec. Repeating relation-based uncache after recording the stale read leaves the cache intact; qualified-name uncache clears it and the next read returns the committed replacement rows.

PR #52599, whose stated purpose is TimeTravelSpec support, also changes this strategy to qualified-name invalidation. We reference that code change as a possible explanation for the passing Spark 4.1.1 control, not as confirmation that this specific defect was reported or fixed there. We have not tested an isolated backport. Please confirm ownership of the V1/V2 invalidation mismatch and whether a focused correction for Spark 4.0.x is appropriate.

主要言語
Scala
スター
44.2k
フォーク
29.5k
平均マージ
8時間 43分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/spark のほかの issue

apache/spark の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。