-
Notifications
You must be signed in to change notification settings - Fork 169
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
[FLINK-37288] Add Google Cloud Spanner dialect and catalog #156
base: main
Are you sure you want to change the base?
[FLINK-37288] Add Google Cloud Spanner dialect and catalog #156
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
this.connectionProperties = Preconditions.checkNotNull(connectionProperties); | ||
checkArgument( | ||
!StringUtils.isNullOrWhitespaceOnly(connectionProperties.getProperty(USER_KEY))); | ||
checkArgument( | ||
!StringUtils.isNullOrWhitespaceOnly( | ||
connectionProperties.getProperty(PASSWORD_KEY))); |
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 does not use password authentication.
/** | ||
* URL has to be without database, like "jdbc:dialect://localhost:1234/" or | ||
* "jdbc:dialect://localhost:1234" rather than "jdbc:dialect://localhost:1234/db". | ||
*/ | ||
protected static void validateJdbcUrl(String url) { | ||
String[] parts = url.trim().split("\\/+"); | ||
|
||
checkArgument(parts.length == 2); | ||
} | ||
|
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.
In the case of Spanner, the URL is as follows, so I have deleted this validation.
jdbc:cloudspanner://hostname/projects/gcp_project_id/instances/instance_id/databases/database_id
|
||
/** Test for {@link AbstractJdbcCatalog}. */ | ||
class AbstractJdbcCatalogTest { |
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.
This class is no longer needed because URL validation has been removed.
@@ -120,7 +122,7 @@ public int[] getTableTypes() { | |||
.toArray(); | |||
} | |||
|
|||
public Schema getTableSchema() { | |||
public Schema getTableSchema(String pkConstraintName) { |
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.
In the case of Spanner, the contract name of the primary key is different, so it is possible to specify the contract name of the primary key.
c7f0a5a
to
3a73e0b
Compare
3a73e0b
to
be60494
Compare
I have applied code formatting using Spotless and updated the documentation. It is ready for review. |
be60494
to
e4559c9
Compare
https://issues.apache.org/jira/browse/FLINK-37288