Skip to content

[Storage] Refactor on getCommits in UC Delta token-based client#6899

Open
ChengJiX wants to merge 1 commit into
delta-io:masterfrom
ChengJiX:loadTable-0
Open

[Storage] Refactor on getCommits in UC Delta token-based client#6899
ChengJiX wants to merge 1 commit into
delta-io:masterfrom
ChengJiX:loadTable-0

Conversation

@ChengJiX
Copy link
Copy Markdown
Collaborator

@ChengJiX ChengJiX commented May 28, 2026

Description

Refactor on getCommits in UC Delta token-based client such that it returns a more general GetCommitsFromLoadTableResponse that can be extended in future to carry more metadata. The current GetCommitsResponse is a narrow interface that would drop additional metadata from loadTable

How was this patch tested?

Existing tests

return new GetCommitsResponse(commits, latestTableVersion);
Optional<io.delta.storage.commit.uniform.UniformMetadata> storageUniform =
toStorageUniformMetadata(response.getUniform());
return new GetCommitsFromLoadTableResponse(commits, latestTableVersion, storageUniform);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @ChengJiX , My question is, as we will always return the general GetCommitsResponse in the UCClient API, then how could we use the Optional<UniformMetadata> uniformMetadata that defined in the concrete GetCommitsFromLoadTableResponse implementation ?

do we need to cast the GetCommitsResponse to GetCommitsFromLoadTableResponse so that we can access the uniformMetadata ?

@@ -0,0 +1,54 @@
/*
* Copyright (2021) The Delta Lake Project Authors.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: The new class will usually use the 2026 copyright.

.stream()
.sorted(Comparator.comparingLong(Commit::getVersion))
.collect(Collectors.toList());
return new GetCommitsResponse(sortedCommits, resp.getLatestTableVersion());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My question is: when will we use the GetCommitsFromLoadTableResponse in the code path ? I still did not see the usage that the place to use the GetCommitsFromLoadTableResponse in this PR, seems like this PR is extending the abstraction.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi @openinx, thanks for review! It would be in next PR. It would be used by downstream consumer like this:

val uniformMetadataOpt = unbackfilledCommitsResponse match {
      case r: GetCommitsFromLoadTableResponse => Option(r.getUniformMetadata).flatMap(_.toScala)
      case _ => None
    }

More specifically, for UniForm conflict resolution, it would be used in listDeltaCompactedDeltaCheckpointFilesAndLatestChecksumFile

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.

2 participants