purbanow commented on a change in pull request #11794:
URL: https://github.com/apache/beam/pull/11794#discussion_r432456811



##########
File path: 
sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java
##########
@@ -339,10 +360,31 @@
       emptyCollection
           .apply(Wait.on(output))
           .apply(ParDo.of(new CleanTmpFilesFromGcsFn(stagingBucketDir)));
-
       return output;
     }
 
+    private void checkArguments(Location loc) {
+      // Either table or query is required. If query is present, it's being 
used, table is used
+      // otherwise
+      checkArgument(loc != null, "via() is required");
+      checkArgument(
+          loc.getStorageIntegrationName() != null,

Review comment:
       1. I think it is more readable with separate method but i agree with you 
that `is odd -- the loc configuration is passed as a parameter while all the 
rest of the configurations are accessed as methods.` that's why I changed 
`checkArguments` method to stop accepting location as argument. 
   
   2. `SnowflakeIO.Read ` requires `storageIntegrationName ` to be always set 
but `SnowflakeIO.Write ` doesn't require that.  The check against null in 
`SnowflakeServiceImpl` is corresponding to `SnowflakeIO.Write ` method




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