Abacn commented on code in PR #32153:
URL: https://github.com/apache/beam/pull/32153#discussion_r1715381602


##########
CHANGES.md:
##########
@@ -68,6 +68,7 @@
 ## New Features / Improvements
 
 * X feature added (Java/Python) 
([#X](https://github.com/apache/beam/issues/X)).
+* Added an ability to set BigQuery endpoint (Java) 
([#28149](https://github.com/apache/beam/issues/28149)).

Review Comment:
   shall we note that this is for testing purpose? Endpoint can be ambiguous 
(e.g. regional/zonal endpoint/ like Dataflow endpoint)
   
   consider "BigQuery endpoint can be overridden via PipelineOptions, this 
enables BigQuery emulators (Java)"



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java:
##########
@@ -1615,8 +1642,13 @@ private static BigQueryWriteClient 
newBigQueryWriteClient(BigQueryOptions option
               .setChannelsPerCpu(2)
               .build();
 
+      BigQueryWriteSettings.Builder builder = 
BigQueryWriteSettings.newBuilder();
+      String endpoint = options.getBigQueryEndpoint();

Review Comment:
   `String` -> `@Nullable String`



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java:
##########
@@ -1615,8 +1642,13 @@ private static BigQueryWriteClient 
newBigQueryWriteClient(BigQueryOptions option
               .setChannelsPerCpu(2)
               .build();
 
+      BigQueryWriteSettings.Builder builder = 
BigQueryWriteSettings.newBuilder();
+      String endpoint = options.getBigQueryEndpoint();
+      if (endpoint != null) {

Review Comment:
   a safer guard is `Strings.isNullOrEmpty`



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to