diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java index 3ed7b778ec..97fc054a27 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClient.java @@ -294,6 +294,12 @@ public final UnaryCallable createWriteStr * `BatchCommitWriteStreams` rpc. * * + *

Note: For users coding against the gRPC api directly, it may be necessary to supply the + * x-goog-request-params system parameter with `write_stream=<full_write_stream_name>`. + * + *

More information about system parameters: + * https://cloud.google.com/apis/docs/system-parameters + * *

Sample code: * *

{@code
@@ -523,7 +529,36 @@ public final FinalizeWriteStreamResponse finalizeWriteStream(FinalizeWriteStream
    *
    * 
{@code
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
-   *   String parent = "parent-995424086";
+   *   TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+   *   BatchCommitWriteStreamsResponse response =
+   *       bigQueryWriteClient.batchCommitWriteStreams(parent);
+   * }
+   * }
+ * + * @param parent Required. Parent table that all the streams should belong to, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(TableName parent) { + BatchCommitWriteStreamsRequest request = + BatchCommitWriteStreamsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return batchCommitWriteStreams(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Atomically commits a group of `PENDING` streams that belong to the same `parent` table. + * + *

Streams must be finalized before commit and cannot be committed multiple times. Once a + * stream is committed, data in the stream becomes available for read operations. + * + *

Sample code: + * + *

{@code
+   * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString();
    *   BatchCommitWriteStreamsResponse response =
    *       bigQueryWriteClient.batchCommitWriteStreams(parent);
    * }
@@ -552,7 +587,7 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(String pare
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
    *           .addAllWriteStreams(new ArrayList())
    *           .build();
    *   BatchCommitWriteStreamsResponse response =
@@ -581,7 +616,7 @@ public final BatchCommitWriteStreamsResponse batchCommitWriteStreams(
    * try (BigQueryWriteClient bigQueryWriteClient = BigQueryWriteClient.create()) {
    *   BatchCommitWriteStreamsRequest request =
    *       BatchCommitWriteStreamsRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(TableName.of("[PROJECT]", "[DATASET]", "[TABLE]").toString())
    *           .addAllWriteStreams(new ArrayList())
    *           .build();
    *   ApiFuture future =
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/gapic_metadata.json b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/gapic_metadata.json
index 50f5dba082..e4541a4a76 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/gapic_metadata.json
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/gapic_metadata.json
@@ -32,7 +32,7 @@
               "methods": ["appendRowsCallable"]
             },
             "BatchCommitWriteStreams": {
-              "methods": ["batchCommitWriteStreams", "batchCommitWriteStreams", "batchCommitWriteStreamsCallable"]
+              "methods": ["batchCommitWriteStreams", "batchCommitWriteStreams", "batchCommitWriteStreams", "batchCommitWriteStreamsCallable"]
             },
             "CreateWriteStream": {
               "methods": ["createWriteStream", "createWriteStream", "createWriteStream", "createWriteStreamCallable"]
diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java
index e930f89fa6..0779aada9d 100644
--- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java
+++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/stub/BigQueryReadStubSettings.java
@@ -214,6 +214,11 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE)));
+      definitions.put(
+          "retry_policy_2_codes",
+          ImmutableSet.copyOf(
+              Lists.newArrayList(
+                  StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
       RETRYABLE_CODE_DEFINITIONS = definitions.build();
     }
 
@@ -244,6 +249,17 @@ public static class Builder extends StubSettings.Builder> definitions =
           ImmutableMap.builder();
       definitions.put(
-          "retry_policy_2_codes",
+          "retry_policy_4_codes",
           ImmutableSet.copyOf(
               Lists.newArrayList(
                   StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
@@ -267,7 +267,7 @@ public static class Builder extends StubSettings.Builder actualRequests = mockBigQueryWrite.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    BatchCommitWriteStreamsRequest actualRequest =
+        ((BatchCommitWriteStreamsRequest) actualRequests.get(0));
+
+    Assert.assertEquals(parent.toString(), actualRequest.getParent());
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  public void batchCommitWriteStreamsExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
+    mockBigQueryWrite.addException(exception);
+
+    try {
+      TableName parent = TableName.of("[PROJECT]", "[DATASET]", "[TABLE]");
+      client.batchCommitWriteStreams(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void batchCommitWriteStreamsTest2() throws Exception {
+    BatchCommitWriteStreamsResponse expectedResponse =
+        BatchCommitWriteStreamsResponse.newBuilder()
+            .setCommitTime(Timestamp.newBuilder().build())
+            .addAllStreamErrors(new ArrayList())
+            .build();
+    mockBigQueryWrite.addResponse(expectedResponse);
+
     String parent = "parent-995424086";
 
     BatchCommitWriteStreamsResponse actualResponse = client.batchCommitWriteStreams(parent);
@@ -411,7 +451,7 @@ public void batchCommitWriteStreamsTest() throws Exception {
   }
 
   @Test
-  public void batchCommitWriteStreamsExceptionTest() throws Exception {
+  public void batchCommitWriteStreamsExceptionTest2() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
     mockBigQueryWrite.addException(exception);
 
diff --git a/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteGrpc.java b/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteGrpc.java
index e6d4a78c92..0c49ab6859 100644
--- a/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteGrpc.java
+++ b/grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteGrpc.java
@@ -424,6 +424,11 @@ public void createWriteStream(
      * * For PENDING streams, data is not made visible until the stream itself is
      * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly
      * committed via the `BatchCommitWriteStreams` rpc.
+     * Note: For users coding against the gRPC api directly, it may be
+     * necessary to supply the x-goog-request-params system parameter
+     * with `write_stream=<full_write_stream_name>`.
+     * More information about system parameters:
+     * https://cloud.google.com/apis/docs/system-parameters
      * 
*/ public io.grpc.stub.StreamObserver @@ -625,6 +630,11 @@ public void createWriteStream( * * For PENDING streams, data is not made visible until the stream itself is * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly * committed via the `BatchCommitWriteStreams` rpc. + * Note: For users coding against the gRPC api directly, it may be + * necessary to supply the x-goog-request-params system parameter + * with `write_stream=<full_write_stream_name>`. + * More information about system parameters: + * https://cloud.google.com/apis/docs/system-parameters *
*/ public io.grpc.stub.StreamObserver diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequest.java index c4ffc75341..4a14f2ffc9 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequest.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequest.java @@ -1387,9 +1387,9 @@ public RowsCase getRowsCase() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -1419,9 +1419,9 @@ public java.lang.String getWriteStream() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -2048,9 +2048,9 @@ public Builder clearRows() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -2079,9 +2079,9 @@ public java.lang.String getWriteStream() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -2110,9 +2110,9 @@ public com.google.protobuf.ByteString getWriteStreamBytes() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -2140,9 +2140,9 @@ public Builder setWriteStream(java.lang.String value) { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -2166,9 +2166,9 @@ public Builder clearWriteStream() { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequestOrBuilder.java index d25b3cc37f..22ecd7805d 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequestOrBuilder.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/AppendRowsRequestOrBuilder.java @@ -32,9 +32,9 @@ public interface AppendRowsRequestOrBuilder * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * @@ -53,9 +53,9 @@ public interface AppendRowsRequestOrBuilder * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. * * * diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequest.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequest.java index 861873ff1f..4ebbed7670 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequest.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequest.java @@ -137,7 +137,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -161,7 +163,9 @@ public java.lang.String getParent() { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -611,7 +615,9 @@ public Builder mergeFrom( * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -634,7 +640,9 @@ public java.lang.String getParent() { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -657,7 +665,9 @@ public com.google.protobuf.ByteString getParentBytes() { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -679,7 +689,9 @@ public Builder setParent(java.lang.String value) { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -697,7 +709,9 @@ public Builder clearParent() { * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequestOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequestOrBuilder.java index 0d5eccc571..a8408f4dac 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequestOrBuilder.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BatchCommitWriteStreamsRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface BatchCommitWriteStreamsRequestOrBuilder * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -44,7 +46,9 @@ public interface BatchCommitWriteStreamsRequestOrBuilder * `projects/{project}/datasets/{dataset}/tables/{table}`. * * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageError.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageError.java index 1240aa7342..d3b2d059b4 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageError.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageError.java @@ -224,6 +224,26 @@ public enum StorageErrorCode implements com.google.protobuf.ProtocolMessageEnum * SCHEMA_MISMATCH_EXTRA_FIELDS = 7; */ SCHEMA_MISMATCH_EXTRA_FIELDS(7), + /** + * + * + *
+     * Offset already exists.
+     * 
+ * + * OFFSET_ALREADY_EXISTS = 8; + */ + OFFSET_ALREADY_EXISTS(8), + /** + * + * + *
+     * Offset out of range.
+     * 
+ * + * OFFSET_OUT_OF_RANGE = 9; + */ + OFFSET_OUT_OF_RANGE(9), UNRECOGNIZED(-1), ; @@ -311,6 +331,26 @@ public enum StorageErrorCode implements com.google.protobuf.ProtocolMessageEnum * SCHEMA_MISMATCH_EXTRA_FIELDS = 7; */ public static final int SCHEMA_MISMATCH_EXTRA_FIELDS_VALUE = 7; + /** + * + * + *
+     * Offset already exists.
+     * 
+ * + * OFFSET_ALREADY_EXISTS = 8; + */ + public static final int OFFSET_ALREADY_EXISTS_VALUE = 8; + /** + * + * + *
+     * Offset out of range.
+     * 
+ * + * OFFSET_OUT_OF_RANGE = 9; + */ + public static final int OFFSET_OUT_OF_RANGE_VALUE = 9; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -352,6 +392,10 @@ public static StorageErrorCode forNumber(int value) { return STREAM_FINALIZED; case 7: return SCHEMA_MISMATCH_EXTRA_FIELDS; + case 8: + return OFFSET_ALREADY_EXISTS; + case 9: + return OFFSET_OUT_OF_RANGE; default: return null; } diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java index e1d0d9ada3..dd10f98b11 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StorageProto.java @@ -188,94 +188,96 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\033.google.protobuf.Int64ValueB\n\n\010response" + "\"Y\n\025GetWriteStreamRequest\022@\n\004name\030\001 \001(\tB" + "2\340A\002\372A,\n*bigquerystorage.googleapis.com/" - + "WriteStream\"Q\n\036BatchCommitWriteStreamsRe" - + "quest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\032\n\rwrite_stre" - + "ams\030\002 \003(\tB\003\340A\002\"\231\001\n\037BatchCommitWriteStrea" - + "msResponse\022/\n\013commit_time\030\001 \001(\0132\032.google" - + ".protobuf.Timestamp\022E\n\rstream_errors\030\002 \003" - + "(\0132..google.cloud.bigquery.storage.v1.St" - + "orageError\"^\n\032FinalizeWriteStreamRequest" - + "\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*bigquerystorage." - + "googleapis.com/WriteStream\"0\n\033FinalizeWr" - + "iteStreamResponse\022\021\n\trow_count\030\001 \001(\003\"\211\001\n" - + "\020FlushRowsRequest\022H\n\014write_stream\030\001 \001(\tB" - + "2\340A\002\372A,\n*bigquerystorage.googleapis.com/" - + "WriteStream\022+\n\006offset\030\002 \001(\0132\033.google.pro" - + "tobuf.Int64Value\"#\n\021FlushRowsResponse\022\016\n" - + "\006offset\030\001 \001(\003\"\361\002\n\014StorageError\022M\n\004code\030\001" - + " \001(\0162?.google.cloud.bigquery.storage.v1." - + "StorageError.StorageErrorCode\022\016\n\006entity\030" - + "\002 \001(\t\022\025\n\rerror_message\030\003 \001(\t\"\352\001\n\020Storage" - + "ErrorCode\022\"\n\036STORAGE_ERROR_CODE_UNSPECIF" - + "IED\020\000\022\023\n\017TABLE_NOT_FOUND\020\001\022\034\n\030STREAM_ALR" - + "EADY_COMMITTED\020\002\022\024\n\020STREAM_NOT_FOUND\020\003\022\027" - + "\n\023INVALID_STREAM_TYPE\020\004\022\030\n\024INVALID_STREA" - + "M_STATE\020\005\022\024\n\020STREAM_FINALIZED\020\006\022 \n\034SCHEM" - + "A_MISMATCH_EXTRA_FIELDS\020\0072\222\006\n\014BigQueryRe" - + "ad\022\351\001\n\021CreateReadSession\022:.google.cloud." - + "bigquery.storage.v1.CreateReadSessionReq" - + "uest\032-.google.cloud.bigquery.storage.v1." - + "ReadSession\"i\202\323\344\223\002<\"7/v1/{read_session.t" - + "able=projects/*/datasets/*/tables/*}:\001*\332" - + "A$parent,read_session,max_stream_count\022\317" - + "\001\n\010ReadRows\0221.google.cloud.bigquery.stor" - + "age.v1.ReadRowsRequest\0322.google.cloud.bi" - + "gquery.storage.v1.ReadRowsResponse\"Z\202\323\344\223" - + "\002?\022=/v1/{read_stream=projects/*/location" - + "s/*/sessions/*/streams/*}\332A\022read_stream," - + "offset0\001\022\306\001\n\017SplitReadStream\0228.google.cl" - + "oud.bigquery.storage.v1.SplitReadStreamR" - + "equest\0329.google.cloud.bigquery.storage.v" - + "1.SplitReadStreamResponse\">\202\323\344\223\0028\0226/v1/{" - + "name=projects/*/locations/*/sessions/*/s" - + "treams/*}\032{\312A\036bigquerystorage.googleapis" - + ".com\322AWhttps://www.googleapis.com/auth/b" - + "igquery,https://www.googleapis.com/auth/" - + "cloud-platform2\274\013\n\rBigQueryWrite\022\327\001\n\021Cre" - + "ateWriteStream\022:.google.cloud.bigquery.s" - + "torage.v1.CreateWriteStreamRequest\032-.goo" - + "gle.cloud.bigquery.storage.v1.WriteStrea" - + "m\"W\202\323\344\223\002;\"+/v1/{parent=projects/*/datase" - + "ts/*/tables/*}:\014write_stream\332A\023parent,wr" - + "ite_stream\022\322\001\n\nAppendRows\0223.google.cloud" - + ".bigquery.storage.v1.AppendRowsRequest\0324" - + ".google.cloud.bigquery.storage.v1.Append" - + "RowsResponse\"U\202\323\344\223\002@\";/v1/{write_stream=" - + "projects/*/datasets/*/tables/*/streams/*" - + "}:\001*\332A\014write_stream(\0010\001\022\277\001\n\016GetWriteStre" - + "am\0227.google.cloud.bigquery.storage.v1.Ge" - + "tWriteStreamRequest\032-.google.cloud.bigqu" - + "ery.storage.v1.WriteStream\"E\202\323\344\223\0028\"3/v1/" - + "{name=projects/*/datasets/*/tables/*/str" - + "eams/*}:\001*\332A\004name\022\331\001\n\023FinalizeWriteStrea" - + "m\022<.google.cloud.bigquery.storage.v1.Fin" - + "alizeWriteStreamRequest\032=.google.cloud.b" - + "igquery.storage.v1.FinalizeWriteStreamRe" - + "sponse\"E\202\323\344\223\0028\"3/v1/{name=projects/*/dat" - + "asets/*/tables/*/streams/*}:\001*\332A\004name\022\334\001" - + "\n\027BatchCommitWriteStreams\022@.google.cloud" - + ".bigquery.storage.v1.BatchCommitWriteStr" - + "eamsRequest\032A.google.cloud.bigquery.stor" - + "age.v1.BatchCommitWriteStreamsResponse\"<" - + "\202\323\344\223\002-\022+/v1/{parent=projects/*/datasets/" - + "*/tables/*}\332A\006parent\022\313\001\n\tFlushRows\0222.goo" - + "gle.cloud.bigquery.storage.v1.FlushRowsR" - + "equest\0323.google.cloud.bigquery.storage.v" - + "1.FlushRowsResponse\"U\202\323\344\223\002@\";/v1/{write_" - + "stream=projects/*/datasets/*/tables/*/st" - + "reams/*}:\001*\332A\014write_stream\032\260\001\312A\036bigquery" - + "storage.googleapis.com\322A\213\001https://www.go" - + "ogleapis.com/auth/bigquery,https://www.g" - + "oogleapis.com/auth/bigquery.insertdata,h" - + "ttps://www.googleapis.com/auth/cloud-pla" - + "tformB\235\002\n$com.google.cloud.bigquery.stor" - + "age.v1B\014StorageProtoP\001ZGgoogle.golang.or" - + "g/genproto/googleapis/cloud/bigquery/sto" - + "rage/v1;storage\252\002 Google.Cloud.BigQuery." - + "Storage.V1\312\002 Google\\Cloud\\BigQuery\\Stora" - + "ge\\V1\352AU\n\035bigquery.googleapis.com/Table\022" - + "4projects/{project}/datasets/{dataset}/t" - + "ables/{table}b\006proto3" + + "WriteStream\"s\n\036BatchCommitWriteStreamsRe" + + "quest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035bigquery." + + "googleapis.com/Table\022\032\n\rwrite_streams\030\002 " + + "\003(\tB\003\340A\002\"\231\001\n\037BatchCommitWriteStreamsResp" + + "onse\022/\n\013commit_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022E\n\rstream_errors\030\002 \003(\0132..g" + + "oogle.cloud.bigquery.storage.v1.StorageE" + + "rror\"^\n\032FinalizeWriteStreamRequest\022@\n\004na" + + "me\030\001 \001(\tB2\340A\002\372A,\n*bigquerystorage.google" + + "apis.com/WriteStream\"0\n\033FinalizeWriteStr" + + "eamResponse\022\021\n\trow_count\030\001 \001(\003\"\211\001\n\020Flush" + + "RowsRequest\022H\n\014write_stream\030\001 \001(\tB2\340A\002\372A" + + ",\n*bigquerystorage.googleapis.com/WriteS" + + "tream\022+\n\006offset\030\002 \001(\0132\033.google.protobuf." + + "Int64Value\"#\n\021FlushRowsResponse\022\016\n\006offse" + + "t\030\001 \001(\003\"\245\003\n\014StorageError\022M\n\004code\030\001 \001(\0162?" + + ".google.cloud.bigquery.storage.v1.Storag" + + "eError.StorageErrorCode\022\016\n\006entity\030\002 \001(\t\022" + + "\025\n\rerror_message\030\003 \001(\t\"\236\002\n\020StorageErrorC" + + "ode\022\"\n\036STORAGE_ERROR_CODE_UNSPECIFIED\020\000\022" + + "\023\n\017TABLE_NOT_FOUND\020\001\022\034\n\030STREAM_ALREADY_C" + + "OMMITTED\020\002\022\024\n\020STREAM_NOT_FOUND\020\003\022\027\n\023INVA" + + "LID_STREAM_TYPE\020\004\022\030\n\024INVALID_STREAM_STAT" + + "E\020\005\022\024\n\020STREAM_FINALIZED\020\006\022 \n\034SCHEMA_MISM" + + "ATCH_EXTRA_FIELDS\020\007\022\031\n\025OFFSET_ALREADY_EX" + + "ISTS\020\010\022\027\n\023OFFSET_OUT_OF_RANGE\020\t2\222\006\n\014BigQ" + + "ueryRead\022\351\001\n\021CreateReadSession\022:.google." + + "cloud.bigquery.storage.v1.CreateReadSess" + + "ionRequest\032-.google.cloud.bigquery.stora" + + "ge.v1.ReadSession\"i\202\323\344\223\002<\"7/v1/{read_ses" + + "sion.table=projects/*/datasets/*/tables/" + + "*}:\001*\332A$parent,read_session,max_stream_c" + + "ount\022\317\001\n\010ReadRows\0221.google.cloud.bigquer" + + "y.storage.v1.ReadRowsRequest\0322.google.cl" + + "oud.bigquery.storage.v1.ReadRowsResponse" + + "\"Z\202\323\344\223\002?\022=/v1/{read_stream=projects/*/lo" + + "cations/*/sessions/*/streams/*}\332A\022read_s" + + "tream,offset0\001\022\306\001\n\017SplitReadStream\0228.goo" + + "gle.cloud.bigquery.storage.v1.SplitReadS" + + "treamRequest\0329.google.cloud.bigquery.sto" + + "rage.v1.SplitReadStreamResponse\">\202\323\344\223\0028\022" + + "6/v1/{name=projects/*/locations/*/sessio" + + "ns/*/streams/*}\032{\312A\036bigquerystorage.goog" + + "leapis.com\322AWhttps://www.googleapis.com/" + + "auth/bigquery,https://www.googleapis.com" + + "/auth/cloud-platform2\274\013\n\rBigQueryWrite\022\327" + + "\001\n\021CreateWriteStream\022:.google.cloud.bigq" + + "uery.storage.v1.CreateWriteStreamRequest" + + "\032-.google.cloud.bigquery.storage.v1.Writ" + + "eStream\"W\202\323\344\223\002;\"+/v1/{parent=projects/*/" + + "datasets/*/tables/*}:\014write_stream\332A\023par" + + "ent,write_stream\022\322\001\n\nAppendRows\0223.google" + + ".cloud.bigquery.storage.v1.AppendRowsReq" + + "uest\0324.google.cloud.bigquery.storage.v1." + + "AppendRowsResponse\"U\202\323\344\223\002@\";/v1/{write_s" + + "tream=projects/*/datasets/*/tables/*/str" + + "eams/*}:\001*\332A\014write_stream(\0010\001\022\277\001\n\016GetWri" + + "teStream\0227.google.cloud.bigquery.storage" + + ".v1.GetWriteStreamRequest\032-.google.cloud" + + ".bigquery.storage.v1.WriteStream\"E\202\323\344\223\0028" + + "\"3/v1/{name=projects/*/datasets/*/tables" + + "/*/streams/*}:\001*\332A\004name\022\331\001\n\023FinalizeWrit" + + "eStream\022<.google.cloud.bigquery.storage." + + "v1.FinalizeWriteStreamRequest\032=.google.c" + + "loud.bigquery.storage.v1.FinalizeWriteSt" + + "reamResponse\"E\202\323\344\223\0028\"3/v1/{name=projects" + + "/*/datasets/*/tables/*/streams/*}:\001*\332A\004n" + + "ame\022\334\001\n\027BatchCommitWriteStreams\022@.google" + + ".cloud.bigquery.storage.v1.BatchCommitWr" + + "iteStreamsRequest\032A.google.cloud.bigquer" + + "y.storage.v1.BatchCommitWriteStreamsResp" + + "onse\"<\202\323\344\223\002-\022+/v1/{parent=projects/*/dat" + + "asets/*/tables/*}\332A\006parent\022\313\001\n\tFlushRows" + + "\0222.google.cloud.bigquery.storage.v1.Flus" + + "hRowsRequest\0323.google.cloud.bigquery.sto" + + "rage.v1.FlushRowsResponse\"U\202\323\344\223\002@\";/v1/{" + + "write_stream=projects/*/datasets/*/table" + + "s/*/streams/*}:\001*\332A\014write_stream\032\260\001\312A\036bi" + + "gquerystorage.googleapis.com\322A\213\001https://" + + "www.googleapis.com/auth/bigquery,https:/" + + "/www.googleapis.com/auth/bigquery.insert" + + "data,https://www.googleapis.com/auth/clo" + + "ud-platformB\235\002\n$com.google.cloud.bigquer" + + "y.storage.v1B\014StorageProtoP\001ZGgoogle.gol" + + "ang.org/genproto/googleapis/cloud/bigque" + + "ry/storage/v1;storage\252\002 Google.Cloud.Big" + + "Query.Storage.V1\312\002 Google\\Cloud\\BigQuery" + + "\\Storage\\V1\352AU\n\035bigquery.googleapis.com/" + + "Table\0224projects/{project}/datasets/{data" + + "set}/tables/{table}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto index 4432e70939..67c6c8a029 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto +++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -167,6 +167,13 @@ service BigQueryWrite { // * For PENDING streams, data is not made visible until the stream itself is // finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly // committed via the `BatchCommitWriteStreams` rpc. + // + // Note: For users coding against the gRPC api directly, it may be + // necessary to supply the x-goog-request-params system parameter + // with `write_stream=`. + // + // More information about system parameters: + // https://cloud.google.com/apis/docs/system-parameters rpc AppendRows(stream AppendRowsRequest) returns (stream AppendRowsResponse) { option (google.api.http) = { post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}" @@ -408,10 +415,12 @@ message AppendRowsRequest { // request. // // For explicitly created write streams, the format is: - // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + // + // * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` // // For the special default stream, the format is: - // `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + // + // * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. string write_stream = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -498,7 +507,10 @@ message BatchCommitWriteStreamsRequest { // Required. Parent table that all the streams should belong to, in the form of // `projects/{project}/datasets/{dataset}/tables/{table}`. string parent = 1 [ - (google.api.field_behavior) = REQUIRED + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } ]; // Required. The group of streams that will be committed atomically. @@ -593,6 +605,12 @@ message StorageError { // There is a schema mismatch and it is caused by user schema has extra // field than bigquery schema. SCHEMA_MISMATCH_EXTRA_FIELDS = 7; + + // Offset already exists. + OFFSET_ALREADY_EXISTS = 8; + + // Offset out of range. + OFFSET_OUT_OF_RANGE = 9; } // BigQuery Storage specific error code.