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

[DTS-2474] Introduce Timestamp and UUID as suffix to table path in RemoteDeltaLog #441

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

linzhou-db
Copy link
Collaborator

Introduce Timestamp and UUID as suffix to table path in RemoteDeltaLog, to avoid two queries on the same table override the CachedTableManager entry for each other.

@linzhou-db linzhou-db changed the title Introduce Timestamp and UUID as suffix to table path in RemoteDeltaLog [DTS-2474] Introduce Timestamp and UUID as suffix to table path in RemoteDeltaLog Dec 1, 2023
@linzhou-db linzhou-db self-assigned this Dec 1, 2023
val dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss")
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
val formattedDateTime = dateFormat.format(System.currentTimeMillis())
val uuid = UUID.randomUUID().toString().split('-').head
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't random uuid sufficient?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

uuid is sufficient, I feel datetime is easier for debugging.

@@ -171,7 +184,8 @@ private[sharing] object RemoteDeltaLog {
java.lang.Boolean.valueOf(sslTrustAll),
java.lang.Boolean.valueOf(forStreaming))
.asInstanceOf[DeltaSharingClient]
new RemoteDeltaLog(deltaSharingTable, new Path(path), client)

new RemoteDeltaLog(deltaSharingTable, new Path(path + getFormattedTimestampWithUUID), client)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need a unit test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let me see if I can add one. unit test should be just for the suffix, the functionality of e2e query is covered by existing tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@linzhou-db linzhou-db merged commit a97b655 into delta-io:branch-0.6 Dec 1, 2023
4 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