Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

fix(samples): bug fix for removing buckets from bq. #548

Merged
merged 14 commits into from Sep 26, 2022
Merged
Expand Up @@ -37,13 +37,15 @@ 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 =
dfirova marked this conversation as resolved.
Show resolved Hide resolved
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";
dfirova marked this conversation as resolved.
Show resolved Hide resolved
// TO CHECK ERROR HANDLING USE THE TABLE WITH INVALID PRODUCTS:
// tableId = "products_some_invalid"

importProductsFromBigQuery(projectId, branchName, datasetId, tableId);
}
Expand Down
Expand Up @@ -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());
Expand Down