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

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

                Author: ASF GitHub Bot
            Created on: 02/Sep/20 12:14
            Start Date: 02/Sep/20 12:14
    Worklog Time Spent: 10m 
      Work Description: purbanow commented on a change in pull request #12618:
URL: https://github.com/apache/beam/pull/12618#discussion_r481966807



##########
File path: 
sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java
##########
@@ -1623,4 +1867,12 @@ public DataSourceConfiguration getConfig() {
       return this.config;
     }
   }
+
+  private static String getValueOrNull(ValueProvider<String> valueProvider) {
+    return valueProvider != null ? valueProvider.get() : null;
+  }
+
+  private static boolean isNotEmpty(ValueProvider<String> valueProvider) {
+    return valueProvider != null && valueProvider.get() != null && 
!valueProvider.get().isEmpty();

Review comment:
       No, it will not throw any exception. We tested it as simple jobs and as 
templates. 
   
   JAVA syntax is working in the way that `valueProvider.get() != nul`l is 
never going to be call if `valueProvider != null ` returns false  + all options 
inside `SnowflakePipelineOptions`have default value or required annotation. 
   
   In terms of using `valueProvider.isAccessible()`, I tried to use it but it 
didn't work as I wanted. Assuming user is going to pass `username` variable  as 
null, then `valueProvider.isAccessible()` is going to return true but calling 
valueProvider.get().isEmpty() will result in `NullPointException`  as 
`valueProvider.get()` is  returning null. 




----------------------------------------------------------------
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: 477821)
    Time Spent: 5h 40m  (was: 5.5h)

> Add support for Dataflow Templates
> ----------------------------------
>
>                 Key: BEAM-10669
>                 URL: https://issues.apache.org/jira/browse/BEAM-10669
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-ideas
>            Reporter: Kasia Kucharczyk
>            Assignee: Kasia Kucharczyk
>            Priority: P2
>          Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> It is required to change arguments to ValueProvider type and move all 
> functionalities of those parameters to extend methods.



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

Reply via email to