diff --git a/samples/interactive-tutorials/src/main/java/product/ImportProductsBigQueryTable.java b/samples/interactive-tutorials/src/main/java/product/ImportProductsBigQueryTable.java index 552751cf..83dce027 100644 --- a/samples/interactive-tutorials/src/main/java/product/ImportProductsBigQueryTable.java +++ b/samples/interactive-tutorials/src/main/java/product/ImportProductsBigQueryTable.java @@ -37,13 +37,16 @@ public class ImportProductsBigQueryTable { public static void main(String[] args) throws IOException, InterruptedException { String projectId = ServiceOptions.getDefaultProjectId(); + // To check for error handling, replace the below variable with the invalid branch name. + // String branchName = "invalid_branch_name"; String branchName = String.format( "projects/%s/locations/global/catalogs/default_catalog/branches/0", projectId); String datasetId = "products"; + // To check for error handling, replace the below variable with table id that contains invalid + // products. + // String tableId = "products_some_invalid"; String tableId = "products"; - // TO CHECK ERROR HANDLING USE THE TABLE WITH INVALID PRODUCTS: - // tableId = "products_some_invalid" importProductsFromBigQuery(projectId, branchName, datasetId, tableId); } diff --git a/samples/interactive-tutorials/src/main/java/product/setup/ProductsCreateBigqueryTable.java b/samples/interactive-tutorials/src/main/java/product/setup/ProductsCreateBigqueryTable.java index a13c0b8d..2463622a 100644 --- a/samples/interactive-tutorials/src/main/java/product/setup/ProductsCreateBigqueryTable.java +++ b/samples/interactive-tutorials/src/main/java/product/setup/ProductsCreateBigqueryTable.java @@ -38,7 +38,7 @@ public static void main(String[] args) throws IOException { String validProductsSourceFile = ProductsCreateBigqueryTable.class.getResource("/products.json").getPath(); String invalidProductsSourceFile = - ProductsCreateBigqueryTable.class.getResource("products_some_invalid.json").getPath(); + ProductsCreateBigqueryTable.class.getResource("/products_some_invalid.json").getPath(); BufferedReader bufferedReader = new BufferedReader(new FileReader(productSchemaFilePath)); String jsonToString = bufferedReader.lines().collect(Collectors.joining());