[ 
https://issues.apache.org/jira/browse/BEAM-9897?focusedWorklogId=457921&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-457921
 ]

ASF GitHub Bot logged work on BEAM-9897:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/20 09:07
            Start Date: 13/Jul/20 09:07
    Worklog Time Spent: 10m 
      Work Description: purbanow commented on a change in pull request #12149:
URL: https://github.com/apache/beam/pull/12149#discussion_r453504599



##########
File path: 
sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java
##########
@@ -960,26 +953,44 @@ public static DataSourceConfiguration create(DataSource 
dataSource) {
      * @param credentials - an instance of {@link SnowflakeCredentials}.
      */
     public static DataSourceConfiguration create(SnowflakeCredentials 
credentials) {
-      if (credentials instanceof UsernamePasswordSnowflakeCredentials) {
-        return new AutoValue_SnowflakeIO_DataSourceConfiguration.Builder()
-            .setValidate(true)
-            .setUsername(((UsernamePasswordSnowflakeCredentials) 
credentials).getUsername())
-            .setPassword(((UsernamePasswordSnowflakeCredentials) 
credentials).getPassword())
-            .build();
-      } else if (credentials instanceof OAuthTokenSnowflakeCredentials) {
-        return new AutoValue_SnowflakeIO_DataSourceConfiguration.Builder()
-            .setValidate(true)
-            .setOauthToken(((OAuthTokenSnowflakeCredentials) 
credentials).getToken())
-            .build();
-      } else if (credentials instanceof KeyPairSnowflakeCredentials) {
-        return new AutoValue_SnowflakeIO_DataSourceConfiguration.Builder()
-            .setValidate(true)
-            .setUsername(((KeyPairSnowflakeCredentials) 
credentials).getUsername())
-            .setPrivateKey(((KeyPairSnowflakeCredentials) 
credentials).getPrivateKey())
-            .build();
-      }
-      throw new IllegalArgumentException(
-          "Can't create DataSourceConfiguration from given credentials");
+      return credentials.createSnowflakeDataSourceConfiguration();
+    }
+
+    /**
+     * Creates {@link DataSourceConfiguration} from instance of {@link

Review comment:
       I removed this improvement from this PR. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 457921)
    Time Spent: 2.5h  (was: 2h 20m)

> Add cross-language support to SnowflakeIO.Read
> ----------------------------------------------
>
>                 Key: BEAM-9897
>                 URL: https://issues.apache.org/jira/browse/BEAM-9897
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-ideas
>            Reporter: Dariusz Aniszewski
>            Priority: P2
>              Labels: stale-P2
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to