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

SQL Extension SHOW LOG with AT #8294

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

leewjae
Copy link

@leewjae leewjae commented Apr 3, 2024

Fixes #4665

Copy link
Member

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks for you contribution @leewjae !

The idea LGTM in general. Please see a couple of concerns below.

val refName = branch
.map(unquoteRefName)
.getOrElse(
NessieUtils.getCurrentRef(api, currentCatalog, catalog).getName
)

val ref = NessieUtils.calculateRef(refName, timestampOrHash, api)
NessieUtils.setCurrentRefForSpark(
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is correct. We probably do not want the SHOW LOG command to change the catalog's active reference (which is the duty of USE REFERENCE).

Copy link
Author

Choose a reason for hiding this comment

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

Now learning how the nessie code works. Changed!


// here we are skipping commit time as its variable
assertThat(
sql("SHOW LOG %s AT %s IN nessie", refName, defaultHash()).stream()
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this test is specific enough as it does not distinguish getting the full log from HEAD and getting log from an older commit.

@snazy snazy changed the title SQL Extension SHOW LOG with AT #4665 SQL Extension SHOW LOG with AT Apr 4, 2024
Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Overall LGTM - just one test case missing

void showLogAt() throws NessieConflictException, NessieNotFoundException {
List<SparkCommitLogEntry> resultList = createBranchCommitAndReturnLog();

// here we are skipping commit time as its variable
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test using the timestamp as in throwWhenUseShowReferencesAtTimestampWithoutTimeZone() ?

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.

SQL Extension SHOW LOG with AT
3 participants