Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spark] Pass catalog table through TahoeLogFileIndex #4150

Conversation

ctring
Copy link
Contributor

@ctring ctring commented Feb 12, 2025

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

TahoeLogFileIndex contains DeltaLog::update calls but it does not pass in the catalog table yet. This causes the check for catalog table existence unreliable in DeltaLog::update. This PR fixes that by adding the catalog table argument to TahoeLogFileIndex and pass the catalog table from DeltaLog::createRelation

How was this patch tested?

Run existing unit tests

Does this PR introduce any user-facing changes?

No

@ctring ctring force-pushed the cuong-nguyen_data/catalog-table-tahoe-index branch from 9297a52 to b0ca9d5 Compare February 13, 2025 07:12
@ctring ctring force-pushed the cuong-nguyen_data/catalog-table-tahoe-index branch from b0ca9d5 to 1e273b9 Compare February 13, 2025 21:06
@@ -181,6 +182,12 @@ object DeltaTestImplicits {
def snapshot: Snapshot = deltaTable.initialSnapshot
}

implicit class TahoeLogFileIndexObjectTestHelper(index: TahoeLogFileIndex.type) {
def apply(spark: SparkSession, deltaLog: DeltaLog): TahoeLogFileIndex = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there existing tests which uses the 2 arg constructor?

Copy link
Contributor Author

@ctring ctring Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. There are quite a few in these files:

val inputFiles = TahoeLogFileIndex(spark, deltaLog).inputFiles.toSeq

val fileIndex = TahoeLogFileIndex(spark, deltaLog)

@allisonport-db allisonport-db merged commit 318e2ec into delta-io:master Feb 14, 2025
16 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants