diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteSchemaTransformProvider.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteSchemaTransformProvider.java index 81ef595d24ff..f50755d18155 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteSchemaTransformProvider.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteSchemaTransformProvider.java @@ -251,6 +251,7 @@ public PCollectionRowTuple expand(@NonNull PCollectionRowTuple input) { public abstract static class SpannerWriteSchemaTransformConfiguration implements Serializable { @SchemaFieldDescription("Specifies the GCP project.") + @Nullable public abstract String getProjectId(); @SchemaFieldDescription("Specifies the Cloud Spanner instance.") @@ -289,10 +290,6 @@ public abstract static class Builder { public void validate() { String invalidConfigMessage = "Invalid Spanner Write configuration: "; - checkArgument( - !Strings.isNullOrEmpty(this.getProjectId()), - invalidConfigMessage + "Project ID for a Spanner Write must be specified."); - checkArgument( !Strings.isNullOrEmpty(this.getInstanceId()), invalidConfigMessage + "Instance ID for a Spanner Write must be specified.");