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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
).
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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()
?
Fixes #4665