Skip to content

Commit 2dc31af

Browse files
Upgrading the driver version from 3.13.24 to 3.14.4
Upgrading the driver version from 3.13.24 to 3.14.4 Added fix for oauth
1 parent 553189b commit 2dc31af

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<powermock.version>1.7.4</powermock.version>
4848
<guice.version>4.0</guice.version>
4949
<opencsv.version>2.4</opencsv.version>
50-
<snowflake-jdbc.version>3.13.24</snowflake-jdbc.version>
50+
<snowflake-jdbc.version>3.14.4</snowflake-jdbc.version>
5151
</properties>
5252

5353
<repositories>

src/main/java/io/cdap/plugin/snowflake/common/client/SnowflakeAccessor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ private void initDataSource(SnowflakeBasicDataSource dataSource, BaseSnowflakeCo
111111
if (config.getOauth2Enabled()) {
112112
String accessToken = OAuthUtil.getAccessTokenByRefreshToken(HttpClients.createDefault(), config);
113113
dataSource.setOauthToken(accessToken);
114+
// The recommend way to pass token is in the password when you use the driver with connection pool.
115+
// This is also a mandatory field, so adding the same.
116+
// Refer https://github.com/snowflakedb/snowflake-jdbc/issues/1175
117+
dataSource.setPassword(accessToken);
114118
} else if (config.getKeyPairEnabled()) {
115119
dataSource.setUser(config.getUsername());
116120

src/main/java/io/cdap/plugin/snowflake/sink/batch/SnowflakeSinkConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public void validate(Schema inputSchema, FailureCollector failureCollector) {
9898
* @param schema input schema to check
9999
*/
100100
private void validateInputSchema(Schema schema, FailureCollector failureCollector) {
101-
// schema can be null in case it is a macro
102-
if (schema == null) {
101+
// return if schema is null or if any of the connection properties or table name is macro
102+
if (schema == null || !canConnect() || containsMacro(PROPERTY_TABLE_NAME)) {
103103
return;
104104
}
105105

0 commit comments

Comments
 (0)