diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java index 71302339af1a..ea3976946ffb 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java @@ -3995,7 +3995,12 @@ ValueProvider getTableWithDefaultProject(BigQueryOptions bqOptio } } - /** Clear the cached map of created tables. Used for testing. */ + /** + * Clear the cached map of created tables. Used for testing only. + * + *

Should not be used in any PTransform as cache is a static member shared by different + * BigQueryIO.write. + */ @VisibleForTesting static void clearStaticCaches() throws ExecutionException, InterruptedException { CreateTables.clearCreatedTables(); diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/DynamicDestinations.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/DynamicDestinations.java index e5cf82d7c2e8..105da60c75b1 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/DynamicDestinations.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/DynamicDestinations.java @@ -132,6 +132,10 @@ void setSideInputAccessorFromProcessContext(DoFn.ProcessContext context) { /** * Returns an object that represents at a high level which table is being written to. May not * return null. + * + *

The method must return a unique object for different destination tables involved over all + * BigQueryIO write transforms in the same pipeline. See + * https://github.com/apache/beam/issues/32335 for details. */ public abstract DestinationT getDestination(@Nullable ValueInSingleWindow element);