-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add flink-connector-jdbc-spnner #1
Conversation
b4eefd9
to
bbaa0ea
Compare
@@ -91,6 +91,8 @@ protected JdbcResultSetBuilder<Row> getResultSetBuilder() { | |||
} else if (type.getConversionClass().equals(LocalDateTime.class)) { | |||
ps.setTimestamp( | |||
i + 1, Timestamp.valueOf(row.<LocalDateTime>getFieldAs(i))); | |||
} else if (type.getConversionClass().equals(Float.class)) { |
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 added handling for the Float type because an error occurred.
com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlBatchUpdateException:
Value has type FLOAT64 which cannot be inserted into column float_col, which has type FLOAT [at 1:131]
...double_col, timestamp9_col) VALUES (@p1, @p2, @p3, @p4, @p5, @p6)
2974caf
to
c6a2441
Compare
209fa32
to
4766a51
Compare
@@ -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.
/** | ||
* 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
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.
|
||
/** 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.
4766a51
to
9d4b764
Compare
No description provided.