mutianf commented on code in PR #28288:
URL: https://github.com/apache/beam/pull/28288#discussion_r1330166796


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java:
##########
@@ -688,14 +688,13 @@ public final String toString() {
     private void validateTableExists(
         BigtableConfig config, BigtableReadOptions readOptions, 
PipelineOptions options) {
       if (config.getValidate() && config.isDataAccessible() && 
readOptions.isDataAccessible()) {
-        String tableId = checkNotNull(readOptions.getTableId().get());
+        ValueProvider<String> tableIdProvider = 
checkArgumentNotNull(readOptions.getTableId());
+        String tableId = checkArgumentNotNull(tableIdProvider.get());
         try {
-          checkArgument(
-              getServiceFactory().checkTableExists(config, options, tableId),
-              "Table %s does not exist",
-              tableId);
+          boolean exists = getServiceFactory().checkTableExists(config, 
options, tableId);
+          checkArgument(exists, "Table %s does not exist", tableId);
         } catch (IOException e) {
-          LOG.warn("Error checking whether table {} exists; proceeding.", 
tableId, e);
+          throw new IllegalArgumentException(e);

Review Comment:
   This is meant to catch exceptions when something went wrong and Bigtable 
client can't connect to the server. In this case we don't know for sure if the 
table exist or not (note that when the table doesn't exist the code will throw 
an error on line 695). So I'm not sure if throwing an exception is the right 
behavior here. 



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to