-
Notifications
You must be signed in to change notification settings - Fork 344
Spanner Persistence Backend for Polaris (Initial change) #3259
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
base: main
Are you sure you want to change the base?
Conversation
|
@talatuyarer : Thanks for reviving Spanner Persistence! Do you intend to drive its implementation end-to-end (not just the first PR)? |
|
Yes This is my plan @dimas-b |
|
@talatuyarer : if you do not mind, please send an email to |
|
@talatuyarer : Since this is a rebase of the work previously submitted in #2328, WDYT about adding @byronellis as a co-author on 0741431? |
Co-authored-by: Byron Ellis <[email protected]>
a175461 to
67a58c2
Compare
|
@dimas-b Make sense. i did not know co author feature. I added him as co author on the commit now. |
|
Thanks for taking over Talat, sorry I haven't had a lot of time for it. FWIW here's the full implementation the first PR was based on. Looks like maybe a lot changed so not sure how relevant it is, but might be of some use: https://github.com/byronellis/polaris/tree/spanner-persistence |
Thank you @byronellis Let me take a look that. |
dimas-b
left a comment
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.
Just one concern about SchemaOptions (which was not affected by #2328), otherwise LGTM 👍
polaris-core/src/main/java/org/apache/polaris/core/persistence/bootstrap/SchemaOptions.java
Outdated
Show resolved
Hide resolved
dimas-b
left a comment
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'll leave the PR open for a couple more days since the original PR had comments from other people. I wonder if they may want to review again.
flyrain
left a comment
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 a lot for rebasing it, @talatuyarer ! This is a good start point for Spanner persistence. Given this PR is a rebased one and the general direction is fine, I think it's OK to merge it as is, or with minor changes. We need to fine issues or and fix forward.
| errorprone = { module = "com.google.errorprone:error_prone_core", version = "2.45.0" } | ||
| google-cloud-iamcredentials = { module = "com.google.cloud:google-cloud-iamcredentials", version = "2.80.0" } | ||
| google-cloud-storage-bom = { module = "com.google.cloud:google-cloud-storage-bom", version = "2.60.0" } | ||
| google-cloud-libraries-bom = { module = "com.google.cloud:libraries-bom", version = "26.72.0" } |
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.
+1, thanks for the change, this makes the versions more consistent across Google Cloud components.
Continuing my review of #2328: a license update is still required. I’m fine with addressing this in a follow-up (see the earlier discussion here: #2328 (comment)).
Would it make sense to file a tracking issue and mark it as a 1.4 release blocker? That would help streamline the release manager’s workflow, since any outstanding license issue will cause a release RC to fail.
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.
SGTM! I can create a follow up PR after merging this.
| @ConfigMapping(prefix = "polaris.persistence.spanner") | ||
| public interface GoogleCloudSpannerConfiguration { | ||
|
|
||
| public Optional<String> quotaProjectId(); |
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.
minor: all methods are public by default in an interface, no need to explicitly add a modifier.
| public Optional<String> quotaProjectId(); | |
| Optional<String> quotaProjectId(); |
| import org.slf4j.LoggerFactory; | ||
|
|
||
| @ApplicationScoped | ||
| public class GoogleCloudSpannerDatabaseClientLifecycleManager { |
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.
Nit: Does it make sense to shorten the name a bit? I think SpannerClientLifecycleManager should be concise and descriptive enough here,
| public class GoogleCloudSpannerDatabaseClientLifecycleManager { | |
| public class SpannerClientLifecycleManager { |
| import java.util.Optional; | ||
|
|
||
| @ConfigMapping(prefix = "polaris.persistence.spanner") | ||
| public interface GoogleCloudSpannerConfiguration { |
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.
Nit: same naming suggestion here
| public interface GoogleCloudSpannerConfiguration { | |
| public interface SpannerConfiguration { |
singhpk234
left a comment
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 @talatuyarer for the contribution !
| `Properties` JSON, | ||
| InternalProperties JSON, |
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.
any reason we want JSON over JSONB seems like spanner supports it : https://docs.cloud.google.com/spanner/docs/working-with-jsonb
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.
Spanner didn't support JSONB in Spanner mode (just PostgreSQL compatibility mode) when this was originally written. :-)
| @@ -0,0 +1,86 @@ | |||
| -- | |||
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.
do we need spanner to also follow v1 of pg / h2 ? since we not using relational-jdbc way of implementing stuff should we just add v3 schema of relational-jdbc here wdyt ?
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.
Following v3 schema of JDBC makes more sense to me, the Spanner impl. doesn't have to support the historical schemas.
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.
Is Spanner schema related to JDBC schema in any way? Why should their respective version numbers be aligned?
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.
Obviously inspired by, but no they're no real relation between the two (and has some Spanner-specific differences)
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 think we should align the versions at least semantically. The schema directly dictates functionality. For example, without the new field in the entity table, the feature configuration ALLOW_TABLE_LOCATION_OVERLAP will not behave as expected. We should avoid a situation where a feature works with JDBC but fails with other persistence implementations due to schema drift.
Rebased @byronellis's Original PR #2328 against latest main branch.
cc @flyrain
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)