pabloem commented on a change in pull request #12618:
URL: https://github.com/apache/beam/pull/12618#discussion_r482399571



##########
File path: 
sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java
##########
@@ -1532,26 +1767,47 @@ public DataSource buildDatasource() {
         SnowflakeBasicDataSource basicDataSource = new 
SnowflakeBasicDataSource();
         basicDataSource.setUrl(buildUrl());
 
-        if (getUsername() != null) {
-          basicDataSource.setUser(getUsername());
+        if (isNotEmpty(getOauthToken())) {
+          basicDataSource.setOauthToken(getOauthToken().get());
+        } else if (isNotEmpty(getUsername()) && getPrivateKey() != null) {
+          basicDataSource.setUser(getUsername().get());
+          basicDataSource.setPrivateKey(getPrivateKey());
+        } else if (isNotEmpty(getUsername())
+            && isNotEmpty(getPrivateKeyPassphrase())
+            && isNotEmpty(getRawPrivateKey())) {
+          PrivateKey privateKey =
+              KeyPairUtils.preparePrivateKey(
+                  getRawPrivateKey().get(), getPrivateKeyPassphrase().get());
+          basicDataSource.setPrivateKey(privateKey);
+          basicDataSource.setUser(getUsername().get());
+

Review comment:
       The only way to 'hide' them would be to remove them from display data. 
It's up to you if you'd like to keep it in DD or remove it.




----------------------------------------------------------------
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]


Reply via email to