From 0def62fb6375d35e753f60dc2ac3b102e15ef336 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 15:13:25 -0500 Subject: [PATCH] feat: add missing_value_interpretations to AppendRowsRequest (#1885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add missing_value_interpretations to AppendRowsRequest PiperOrigin-RevId: 488693558 Source-Link: https://github.com/googleapis/googleapis/commit/43bf96fa41b19ed90790e157a0d0d22ecd20c0d8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1532dc6fd5b52a53613304e75aac1b5da407b6b3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTUzMmRjNmZkNWI1MmE1MzYxMzMwNGU3NWFhYzFiNWRhNDA3YjZiMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../storage/v1/BigQueryWriteClient.java | 2 + .../storage/v1/BigQueryWriteClientTest.java | 5 + .../storage/v1/AppendRowsRequest.java | 1023 +++++++++++++++++ .../v1/AppendRowsRequestOrBuilder.java | 220 ++++ .../bigquery/storage/v1/StorageProto.java | 255 ++-- .../cloud/bigquery/storage/v1/storage.proto | 37 + 6 files changed, 1429 insertions(+), 113 deletions(-) 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 485680e7c1..8d2cc893a9 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 @@ -342,6 +342,8 @@ public final UnaryCallable createWriteStr * WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString()) * .setOffset(Int64Value.newBuilder().build()) * .setTraceId("traceId-1067401920") + * .putAllMissingValueInterpretations( + * new HashMap()) * .build(); * bidiStream.send(request); * for (AppendRowsResponse response : bidiStream) { diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java index 980ca568ea..6cdfea4704 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BigQueryWriteClientTest.java @@ -34,6 +34,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -188,6 +189,8 @@ public void appendRowsTest() throws Exception { WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString()) .setOffset(Int64Value.newBuilder().build()) .setTraceId("traceId-1067401920") + .putAllMissingValueInterpretations( + new HashMap()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -215,6 +218,8 @@ public void appendRowsExceptionTest() throws Exception { WriteStreamName.of("[PROJECT]", "[DATASET]", "[TABLE]", "[STREAM]").toString()) .setOffset(Int64Value.newBuilder().build()) .setTraceId("traceId-1067401920") + .putAllMissingValueInterpretations( + new HashMap()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); 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 d3723a0085..abc2eb3328 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 @@ -63,6 +63,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetMissingValueInterpretations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -73,6 +84,176 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.bigquery.storage.v1.AppendRowsRequest.Builder.class); } + /** + * + * + *
+   * An enum to indicate how to interpret missing values. Missing values are
+   * fields present in user schema but missing in rows. A missing value can
+   * represent a NULL or a column default value defined in BigQuery table
+   * schema.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation} + */ + public enum MissingValueInterpretation implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid missing value interpretation. Requests with this value will be
+     * rejected.
+     * 
+ * + * MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0; + */ + MISSING_VALUE_INTERPRETATION_UNSPECIFIED(0), + /** + * + * + *
+     * Missing value is interpreted as NULL.
+     * 
+ * + * NULL_VALUE = 1; + */ + NULL_VALUE(1), + /** + * + * + *
+     * Missing value is interpreted as column default value if declared in the
+     * table schema, NULL otherwise.
+     * 
+ * + * DEFAULT_VALUE = 2; + */ + DEFAULT_VALUE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid missing value interpretation. Requests with this value will be
+     * rejected.
+     * 
+ * + * MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0; + */ + public static final int MISSING_VALUE_INTERPRETATION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Missing value is interpreted as NULL.
+     * 
+ * + * NULL_VALUE = 1; + */ + public static final int NULL_VALUE_VALUE = 1; + /** + * + * + *
+     * Missing value is interpreted as column default value if declared in the
+     * table schema, NULL otherwise.
+     * 
+ * + * DEFAULT_VALUE = 2; + */ + public static final int DEFAULT_VALUE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MissingValueInterpretation valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MissingValueInterpretation forNumber(int value) { + switch (value) { + case 0: + return MISSING_VALUE_INTERPRETATION_UNSPECIFIED; + case 1: + return NULL_VALUE; + case 2: + return DEFAULT_VALUE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MissingValueInterpretation findValueByNumber(int number) { + return MissingValueInterpretation.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.storage.v1.AppendRowsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MissingValueInterpretation[] VALUES = values(); + + public static MissingValueInterpretation valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MissingValueInterpretation(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation) + } + public interface ProtoDataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData) @@ -1475,6 +1656,312 @@ public com.google.protobuf.ByteString getTraceIdBytes() { } } + public static final int MISSING_VALUE_INTERPRETATIONS_FIELD_NUMBER = 7; + + private static final class MissingValueInterpretationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.bigquery.storage.v1.StorageProto + .internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.ENUM, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + .MISSING_VALUE_INTERPRETATION_UNSPECIFIED + .getNumber()); + } + + private com.google.protobuf.MapField + missingValueInterpretations_; + + private com.google.protobuf.MapField + internalGetMissingValueInterpretations() { + if (missingValueInterpretations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MissingValueInterpretationsDefaultEntryHolder.defaultEntry); + } + return missingValueInterpretations_; + } + + private static final com.google.protobuf.Internal.MapAdapter.Converter< + java.lang.Integer, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + missingValueInterpretationsValueConverter = + com.google.protobuf.Internal.MapAdapter.newEnumConverter( + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + .internalGetValueMap(), + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + .UNRECOGNIZED); + + private static final java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + internalGetAdaptedMissingValueInterpretationsMap( + java.util.Map map) { + return new com.google.protobuf.Internal.MapAdapter< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation, + java.lang.Integer>(map, missingValueInterpretationsValueConverter); + } + + public int getMissingValueInterpretationsCount() { + return internalGetMissingValueInterpretations().getMap().size(); + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public boolean containsMissingValueInterpretations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMissingValueInterpretations().getMap().containsKey(key); + } + /** Use {@link #getMissingValueInterpretationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretations() { + return getMissingValueInterpretationsMap(); + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretationsMap() { + return internalGetAdaptedMissingValueInterpretationsMap( + internalGetMissingValueInterpretations().getMap()); + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.bigquery.storage.v1.AppendRowsRequest + .MissingValueInterpretation + getMissingValueInterpretationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + return map.containsKey(key) + ? missingValueInterpretationsValueConverter.doForward(map.get(key)) + : defaultValue; + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + getMissingValueInterpretationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return missingValueInterpretationsValueConverter.doForward(map.get(key)); + } + /** Use {@link #getMissingValueInterpretationsValueMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMissingValueInterpretationsValue() { + return getMissingValueInterpretationsValueMap(); + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public java.util.Map + getMissingValueInterpretationsValueMap() { + return internalGetMissingValueInterpretations().getMap(); + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public int getMissingValueInterpretationsValueOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public int getMissingValueInterpretationsValueOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1508,6 +1995,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, traceId_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetMissingValueInterpretations(), + MissingValueInterpretationsDefaultEntryHolder.defaultEntry, + 7); getUnknownFields().writeTo(output); } @@ -1531,6 +2023,19 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, traceId_); } + for (java.util.Map.Entry entry : + internalGetMissingValueInterpretations().getMap().entrySet()) { + com.google.protobuf.MapEntry + missingValueInterpretations__ = + MissingValueInterpretationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, missingValueInterpretations__); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1553,6 +2058,8 @@ public boolean equals(final java.lang.Object obj) { if (!getOffset().equals(other.getOffset())) return false; } if (!getTraceId().equals(other.getTraceId())) return false; + if (!internalGetMissingValueInterpretations() + .equals(other.internalGetMissingValueInterpretations())) return false; if (!getRowsCase().equals(other.getRowsCase())) return false; switch (rowsCase_) { case 4: @@ -1580,6 +2087,10 @@ public int hashCode() { } hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; hash = (53 * hash) + getTraceId().hashCode(); + if (!internalGetMissingValueInterpretations().getMap().isEmpty()) { + hash = (37 * hash) + MISSING_VALUE_INTERPRETATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMissingValueInterpretations().hashCode(); + } switch (rowsCase_) { case 4: hash = (37 * hash) + PROTO_ROWS_FIELD_NUMBER; @@ -1712,6 +2223,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetMissingValueInterpretations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableMissingValueInterpretations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -1745,6 +2276,7 @@ public Builder clear() { } traceId_ = ""; + internalGetMutableMissingValueInterpretations().clear(); rowsCase_ = 0; rows_ = null; return this; @@ -1774,6 +2306,7 @@ public com.google.cloud.bigquery.storage.v1.AppendRowsRequest build() { public com.google.cloud.bigquery.storage.v1.AppendRowsRequest buildPartial() { com.google.cloud.bigquery.storage.v1.AppendRowsRequest result = new com.google.cloud.bigquery.storage.v1.AppendRowsRequest(this); + int from_bitField0_ = bitField0_; result.writeStream_ = writeStream_; if (offsetBuilder_ == null) { result.offset_ = offset_; @@ -1788,6 +2321,8 @@ public com.google.cloud.bigquery.storage.v1.AppendRowsRequest buildPartial() { } } result.traceId_ = traceId_; + result.missingValueInterpretations_ = internalGetMissingValueInterpretations(); + result.missingValueInterpretations_.makeImmutable(); result.rowsCase_ = rowsCase_; onBuilt(); return result; @@ -1850,6 +2385,8 @@ public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.AppendRowsRequest traceId_ = other.traceId_; onChanged(); } + internalGetMutableMissingValueInterpretations() + .mergeFrom(other.internalGetMissingValueInterpretations()); switch (other.getRowsCase()) { case PROTO_ROWS: { @@ -1916,6 +2453,21 @@ public Builder mergeFrom( break; } // case 50 + case 58: + { + com.google.protobuf.MapEntry + missingValueInterpretations__ = + input.readMessage( + MissingValueInterpretationsDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableMissingValueInterpretations() + .getMutableMap() + .put( + missingValueInterpretations__.getKey(), + missingValueInterpretations__.getValue()); + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1947,6 +2499,8 @@ public Builder clearRows() { return this; } + private int bitField0_; + private java.lang.Object writeStream_ = ""; /** * @@ -2635,6 +3189,475 @@ public Builder setTraceIdBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.MapField + missingValueInterpretations_; + + private com.google.protobuf.MapField + internalGetMissingValueInterpretations() { + if (missingValueInterpretations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MissingValueInterpretationsDefaultEntryHolder.defaultEntry); + } + return missingValueInterpretations_; + } + + private com.google.protobuf.MapField + internalGetMutableMissingValueInterpretations() { + onChanged(); + ; + if (missingValueInterpretations_ == null) { + missingValueInterpretations_ = + com.google.protobuf.MapField.newMapField( + MissingValueInterpretationsDefaultEntryHolder.defaultEntry); + } + if (!missingValueInterpretations_.isMutable()) { + missingValueInterpretations_ = missingValueInterpretations_.copy(); + } + return missingValueInterpretations_; + } + + public int getMissingValueInterpretationsCount() { + return internalGetMissingValueInterpretations().getMap().size(); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public boolean containsMissingValueInterpretations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMissingValueInterpretations().getMap().containsKey(key); + } + /** Use {@link #getMissingValueInterpretationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretations() { + return getMissingValueInterpretationsMap(); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretationsMap() { + return internalGetAdaptedMissingValueInterpretationsMap( + internalGetMissingValueInterpretations().getMap()); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.bigquery.storage.v1.AppendRowsRequest + .MissingValueInterpretation + getMissingValueInterpretationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + return map.containsKey(key) + ? missingValueInterpretationsValueConverter.doForward(map.get(key)) + : defaultValue; + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + getMissingValueInterpretationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return missingValueInterpretationsValueConverter.doForward(map.get(key)); + } + /** Use {@link #getMissingValueInterpretationsValueMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMissingValueInterpretationsValue() { + return getMissingValueInterpretationsValueMap(); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public java.util.Map + getMissingValueInterpretationsValueMap() { + return internalGetMissingValueInterpretations().getMap(); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public int getMissingValueInterpretationsValueOrDefault( + java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + @java.lang.Override + public int getMissingValueInterpretationsValueOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMissingValueInterpretations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMissingValueInterpretations() { + internalGetMutableMissingValueInterpretations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + public Builder removeMissingValueInterpretations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMissingValueInterpretations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMutableMissingValueInterpretations() { + return internalGetAdaptedMissingValueInterpretationsMap( + internalGetMutableMissingValueInterpretations().getMutableMap()); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + public Builder putMissingValueInterpretations( + java.lang.String key, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableMissingValueInterpretations() + .getMutableMap() + .put(key, missingValueInterpretationsValueConverter.doBackward(value)); + return this; + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + public Builder putAllMissingValueInterpretations( + java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + values) { + internalGetAdaptedMissingValueInterpretationsMap( + internalGetMutableMissingValueInterpretations().getMutableMap()) + .putAll(values); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableMissingValueInterpretationsValue() { + return internalGetMutableMissingValueInterpretations().getMutableMap(); + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + public Builder putMissingValueInterpretationsValue(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableMissingValueInterpretations().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A map to indicate how to interpret missing value for some fields. Missing
+     * values are fields present in user schema but missing in rows. The key is
+     * the field name. The value is the interpretation of missing values for the
+     * field.
+     * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+     * missing values in field foo are interpreted as NULL, all missing values in
+     * field bar are interpreted as the default value of field bar in table
+     * schema.
+     * If a field is not in this map and has missing values, the missing values
+     * in this field are interpreted as NULL.
+     * This field only applies to the current request, it won't affect other
+     * requests on the connection.
+     * Currently, field name can only be top-level column name, can't be a struct
+     * field path like 'foo.bar'.
+     * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + public Builder putAllMissingValueInterpretationsValue( + java.util.Map values) { + internalGetMutableMissingValueInterpretations().getMutableMap().putAll(values); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); 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 22ecd7805d..88a471f15c 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 @@ -172,5 +172,225 @@ public interface AppendRowsRequestOrBuilder */ com.google.protobuf.ByteString getTraceIdBytes(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + int getMissingValueInterpretationsCount(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + boolean containsMissingValueInterpretations(java.lang.String key); + /** Use {@link #getMissingValueInterpretationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretations(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + java.util.Map< + java.lang.String, + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> + getMissingValueInterpretationsMap(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + /* nullable */ + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + getMissingValueInterpretationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + defaultValue); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation + getMissingValueInterpretationsOrThrow(java.lang.String key); + /** Use {@link #getMissingValueInterpretationsValueMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMissingValueInterpretationsValue(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + java.util.Map getMissingValueInterpretationsValueMap(); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + int getMissingValueInterpretationsValueOrDefault(java.lang.String key, int defaultValue); + /** + * + * + *
+   * A map to indicate how to interpret missing value for some fields. Missing
+   * values are fields present in user schema but missing in rows. The key is
+   * the field name. The value is the interpretation of missing values for the
+   * field.
+   * For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all
+   * missing values in field foo are interpreted as NULL, all missing values in
+   * field bar are interpreted as the default value of field bar in table
+   * schema.
+   * If a field is not in this map and has missing values, the missing values
+   * in this field are interpreted as NULL.
+   * This field only applies to the current request, it won't affect other
+   * requests on the connection.
+   * Currently, field name can only be top-level column name, can't be a struct
+   * field path like 'foo.bar'.
+   * 
+ * + * + * map<string, .google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation> missing_value_interpretations = 7; + * + */ + int getMissingValueInterpretationsValueOrThrow(java.lang.String key); + public com.google.cloud.bigquery.storage.v1.AppendRowsRequest.RowsCase getRowsCase(); } 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 09b7f4b778..e91cfc536f 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 @@ -71,6 +71,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_ProtoData_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_ProtoData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_bigquery_storage_v1_AppendRowsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -173,124 +177,134 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "iteStreamRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037" + "\n\035bigquery.googleapis.com/Table\022H\n\014write" + "_stream\030\002 \001(\0132-.google.cloud.bigquery.st" - + "orage.v1.WriteStreamB\003\340A\002\"\210\003\n\021AppendRows" + + "orage.v1.WriteStreamB\003\340A\002\"\211\006\n\021AppendRows" + "Request\022H\n\014write_stream\030\001 \001(\tB2\340A\002\372A,\n*b" + "igquerystorage.googleapis.com/WriteStrea" + "m\022+\n\006offset\030\002 \001(\0132\033.google.protobuf.Int6" + "4Value\022S\n\nproto_rows\030\004 \001(\0132=.google.clou" + "d.bigquery.storage.v1.AppendRowsRequest." - + "ProtoDataH\000\022\020\n\010trace_id\030\006 \001(\t\032\214\001\n\tProtoD" - + "ata\022D\n\rwriter_schema\030\001 \001(\0132-.google.clou" - + "d.bigquery.storage.v1.ProtoSchema\0229\n\004row" - + "s\030\002 \001(\0132+.google.cloud.bigquery.storage." - + "v1.ProtoRowsB\006\n\004rows\"\373\002\n\022AppendRowsRespo" - + "nse\022Z\n\rappend_result\030\001 \001(\0132A.google.clou" - + "d.bigquery.storage.v1.AppendRowsResponse" - + ".AppendResultH\000\022#\n\005error\030\002 \001(\0132\022.google." - + "rpc.StatusH\000\022E\n\016updated_schema\030\003 \001(\0132-.g" - + "oogle.cloud.bigquery.storage.v1.TableSch" - + "ema\022>\n\nrow_errors\030\004 \003(\0132*.google.cloud.b" - + "igquery.storage.v1.RowError\022\024\n\014write_str" - + "eam\030\005 \001(\t\032;\n\014AppendResult\022+\n\006offset\030\001 \001(" - + "\0132\033.google.protobuf.Int64ValueB\n\n\010respon" - + "se\"\232\001\n\025GetWriteStreamRequest\022@\n\004name\030\001 \001" - + "(\tB2\340A\002\372A,\n*bigquerystorage.googleapis.c" - + "om/WriteStream\022?\n\004view\030\003 \001(\01621.google.cl" - + "oud.bigquery.storage.v1.WriteStreamView\"" - + "s\n\036BatchCommitWriteStreamsRequest\0225\n\006par" - + "ent\030\001 \001(\tB%\340A\002\372A\037\n\035bigquery.googleapis.c" - + "om/Table\022\032\n\rwrite_streams\030\002 \003(\tB\003\340A\002\"\231\001\n" - + "\037BatchCommitWriteStreamsResponse\022/\n\013comm" - + "it_time\030\001 \001(\0132\032.google.protobuf.Timestam" - + "p\022E\n\rstream_errors\030\002 \003(\0132..google.cloud." - + "bigquery.storage.v1.StorageError\"^\n\032Fina" - + "lizeWriteStreamRequest\022@\n\004name\030\001 \001(\tB2\340A" - + "\002\372A,\n*bigquerystorage.googleapis.com/Wri" - + "teStream\"0\n\033FinalizeWriteStreamResponse\022" - + "\021\n\trow_count\030\001 \001(\003\"\211\001\n\020FlushRowsRequest\022" - + "H\n\014write_stream\030\001 \001(\tB2\340A\002\372A,\n*bigquerys" - + "torage.googleapis.com/WriteStream\022+\n\006off" - + "set\030\002 \001(\0132\033.google.protobuf.Int64Value\"#" - + "\n\021FlushRowsResponse\022\016\n\006offset\030\001 \001(\003\"\245\003\n\014" - + "StorageError\022M\n\004code\030\001 \001(\0162?.google.clou" - + "d.bigquery.storage.v1.StorageError.Stora" - + "geErrorCode\022\016\n\006entity\030\002 \001(\t\022\025\n\rerror_mes" - + "sage\030\003 \001(\t\"\236\002\n\020StorageErrorCode\022\"\n\036STORA" - + "GE_ERROR_CODE_UNSPECIFIED\020\000\022\023\n\017TABLE_NOT" - + "_FOUND\020\001\022\034\n\030STREAM_ALREADY_COMMITTED\020\002\022\024" - + "\n\020STREAM_NOT_FOUND\020\003\022\027\n\023INVALID_STREAM_T" - + "YPE\020\004\022\030\n\024INVALID_STREAM_STATE\020\005\022\024\n\020STREA" - + "M_FINALIZED\020\006\022 \n\034SCHEMA_MISMATCH_EXTRA_F" - + "IELDS\020\007\022\031\n\025OFFSET_ALREADY_EXISTS\020\010\022\027\n\023OF" - + "FSET_OUT_OF_RANGE\020\t\"\263\001\n\010RowError\022\r\n\005inde" - + "x\030\001 \001(\003\022E\n\004code\030\002 \001(\01627.google.cloud.big" - + "query.storage.v1.RowError.RowErrorCode\022\017" - + "\n\007message\030\003 \001(\t\"@\n\014RowErrorCode\022\036\n\032ROW_E" - + "RROR_CODE_UNSPECIFIED\020\000\022\020\n\014FIELDS_ERROR\020" - + "\0012\222\006\n\014BigQueryRead\022\351\001\n\021CreateReadSession" - + "\022:.google.cloud.bigquery.storage.v1.Crea" - + "teReadSessionRequest\032-.google.cloud.bigq" - + "uery.storage.v1.ReadSession\"i\202\323\344\223\002<\"7/v1" - + "/{read_session.table=projects/*/datasets" - + "/*/tables/*}:\001*\332A$parent,read_session,ma" - + "x_stream_count\022\317\001\n\010ReadRows\0221.google.clo" - + "ud.bigquery.storage.v1.ReadRowsRequest\0322" - + ".google.cloud.bigquery.storage.v1.ReadRo" - + "wsResponse\"Z\202\323\344\223\002?\022=/v1/{read_stream=pro" - + "jects/*/locations/*/sessions/*/streams/*" - + "}\332A\022read_stream,offset0\001\022\306\001\n\017SplitReadSt" - + "ream\0228.google.cloud.bigquery.storage.v1." - + "SplitReadStreamRequest\0329.google.cloud.bi" - + "gquery.storage.v1.SplitReadStreamRespons" - + "e\">\202\323\344\223\0028\0226/v1/{name=projects/*/location" - + "s/*/sessions/*/streams/*}\032{\312A\036bigqueryst" - + "orage.googleapis.com\322AWhttps://www.googl" - + "eapis.com/auth/bigquery,https://www.goog" - + "leapis.com/auth/cloud-platform2\274\013\n\rBigQu" - + "eryWrite\022\327\001\n\021CreateWriteStream\022:.google." - + "cloud.bigquery.storage.v1.CreateWriteStr" - + "eamRequest\032-.google.cloud.bigquery.stora" - + "ge.v1.WriteStream\"W\202\323\344\223\002;\"+/v1/{parent=p" - + "rojects/*/datasets/*/tables/*}:\014write_st" - + "ream\332A\023parent,write_stream\022\322\001\n\nAppendRow" - + "s\0223.google.cloud.bigquery.storage.v1.App" - + "endRowsRequest\0324.google.cloud.bigquery.s" - + "torage.v1.AppendRowsResponse\"U\202\323\344\223\002@\";/v" - + "1/{write_stream=projects/*/datasets/*/ta" - + "bles/*/streams/*}:\001*\332A\014write_stream(\0010\001\022" - + "\277\001\n\016GetWriteStream\0227.google.cloud.bigque" - + "ry.storage.v1.GetWriteStreamRequest\032-.go" + + "ProtoDataH\000\022\020\n\010trace_id\030\006 \001(\t\022{\n\035missing" + + "_value_interpretations\030\007 \003(\0132T.google.cl" + + "oud.bigquery.storage.v1.AppendRowsReques" + + "t.MissingValueInterpretationsEntry\032\214\001\n\tP" + + "rotoData\022D\n\rwriter_schema\030\001 \001(\0132-.google" + + ".cloud.bigquery.storage.v1.ProtoSchema\0229" + + "\n\004rows\030\002 \001(\0132+.google.cloud.bigquery.sto" + + "rage.v1.ProtoRows\032\222\001\n MissingValueInterp" + + "retationsEntry\022\013\n\003key\030\001 \001(\t\022]\n\005value\030\002 \001" + + "(\0162N.google.cloud.bigquery.storage.v1.Ap" + + "pendRowsRequest.MissingValueInterpretati" + + "on:\0028\001\"m\n\032MissingValueInterpretation\022,\n(" + + "MISSING_VALUE_INTERPRETATION_UNSPECIFIED" + + "\020\000\022\016\n\nNULL_VALUE\020\001\022\021\n\rDEFAULT_VALUE\020\002B\006\n" + + "\004rows\"\373\002\n\022AppendRowsResponse\022Z\n\rappend_r" + + "esult\030\001 \001(\0132A.google.cloud.bigquery.stor" + + "age.v1.AppendRowsResponse.AppendResultH\000" + + "\022#\n\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\022E\n" + + "\016updated_schema\030\003 \001(\0132-.google.cloud.big" + + "query.storage.v1.TableSchema\022>\n\nrow_erro" + + "rs\030\004 \003(\0132*.google.cloud.bigquery.storage" + + ".v1.RowError\022\024\n\014write_stream\030\005 \001(\t\032;\n\014Ap" + + "pendResult\022+\n\006offset\030\001 \001(\0132\033.google.prot" + + "obuf.Int64ValueB\n\n\010response\"\232\001\n\025GetWrite" + + "StreamRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*big" + + "querystorage.googleapis.com/WriteStream\022" + + "?\n\004view\030\003 \001(\01621.google.cloud.bigquery.st" + + "orage.v1.WriteStreamView\"s\n\036BatchCommitW" + + "riteStreamsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372" + + "A\037\n\035bigquery.googleapis.com/Table\022\032\n\rwri" + + "te_streams\030\002 \003(\tB\003\340A\002\"\231\001\n\037BatchCommitWri" + + "teStreamsResponse\022/\n\013commit_time\030\001 \001(\0132\032" + + ".google.protobuf.Timestamp\022E\n\rstream_err" + + "ors\030\002 \003(\0132..google.cloud.bigquery.storag" + + "e.v1.StorageError\"^\n\032FinalizeWriteStream" + + "Request\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*bigquerys" + + "torage.googleapis.com/WriteStream\"0\n\033Fin" + + "alizeWriteStreamResponse\022\021\n\trow_count\030\001 " + + "\001(\003\"\211\001\n\020FlushRowsRequest\022H\n\014write_stream" + + "\030\001 \001(\tB2\340A\002\372A,\n*bigquerystorage.googleap" + + "is.com/WriteStream\022+\n\006offset\030\002 \001(\0132\033.goo" + + "gle.protobuf.Int64Value\"#\n\021FlushRowsResp" + + "onse\022\016\n\006offset\030\001 \001(\003\"\245\003\n\014StorageError\022M\n" + + "\004code\030\001 \001(\0162?.google.cloud.bigquery.stor" + + "age.v1.StorageError.StorageErrorCode\022\016\n\006" + + "entity\030\002 \001(\t\022\025\n\rerror_message\030\003 \001(\t\"\236\002\n\020" + + "StorageErrorCode\022\"\n\036STORAGE_ERROR_CODE_U" + + "NSPECIFIED\020\000\022\023\n\017TABLE_NOT_FOUND\020\001\022\034\n\030STR" + + "EAM_ALREADY_COMMITTED\020\002\022\024\n\020STREAM_NOT_FO" + + "UND\020\003\022\027\n\023INVALID_STREAM_TYPE\020\004\022\030\n\024INVALI" + + "D_STREAM_STATE\020\005\022\024\n\020STREAM_FINALIZED\020\006\022 " + + "\n\034SCHEMA_MISMATCH_EXTRA_FIELDS\020\007\022\031\n\025OFFS" + + "ET_ALREADY_EXISTS\020\010\022\027\n\023OFFSET_OUT_OF_RAN" + + "GE\020\t\"\263\001\n\010RowError\022\r\n\005index\030\001 \001(\003\022E\n\004code" + + "\030\002 \001(\01627.google.cloud.bigquery.storage.v" + + "1.RowError.RowErrorCode\022\017\n\007message\030\003 \001(\t" + + "\"@\n\014RowErrorCode\022\036\n\032ROW_ERROR_CODE_UNSPE" + + "CIFIED\020\000\022\020\n\014FIELDS_ERROR\020\0012\222\006\n\014BigQueryR" + + "ead\022\351\001\n\021CreateReadSession\022:.google.cloud" + + ".bigquery.storage.v1.CreateReadSessionRe" + + "quest\032-.google.cloud.bigquery.storage.v1" + + ".ReadSession\"i\202\323\344\223\002<\"7/v1/{read_session." + + "table=projects/*/datasets/*/tables/*}:\001*" + + "\332A$parent,read_session,max_stream_count\022" + + "\317\001\n\010ReadRows\0221.google.cloud.bigquery.sto" + + "rage.v1.ReadRowsRequest\0322.google.cloud.b" + + "igquery.storage.v1.ReadRowsResponse\"Z\202\323\344" + + "\223\002?\022=/v1/{read_stream=projects/*/locatio" + + "ns/*/sessions/*/streams/*}\332A\022read_stream" + + ",offset0\001\022\306\001\n\017SplitReadStream\0228.google.c" + + "loud.bigquery.storage.v1.SplitReadStream" + + "Request\0329.google.cloud.bigquery.storage." + + "v1.SplitReadStreamResponse\">\202\323\344\223\0028\0226/v1/" + + "{name=projects/*/locations/*/sessions/*/" + + "streams/*}\032{\312A\036bigquerystorage.googleapi" + + "s.com\322AWhttps://www.googleapis.com/auth/" + + "bigquery,https://www.googleapis.com/auth" + + "/cloud-platform2\274\013\n\rBigQueryWrite\022\327\001\n\021Cr" + + "eateWriteStream\022:.google.cloud.bigquery." + + "storage.v1.CreateWriteStreamRequest\032-.go" + "ogle.cloud.bigquery.storage.v1.WriteStre" - + "am\"E\202\323\344\223\0028\"3/v1/{name=projects/*/dataset" - + "s/*/tables/*/streams/*}:\001*\332A\004name\022\331\001\n\023Fi" - + "nalizeWriteStream\022<.google.cloud.bigquer" - + "y.storage.v1.FinalizeWriteStreamRequest\032" - + "=.google.cloud.bigquery.storage.v1.Final" - + "izeWriteStreamResponse\"E\202\323\344\223\0028\"3/v1/{nam" - + "e=projects/*/datasets/*/tables/*/streams" - + "/*}:\001*\332A\004name\022\334\001\n\027BatchCommitWriteStream" - + "s\022@.google.cloud.bigquery.storage.v1.Bat" - + "chCommitWriteStreamsRequest\032A.google.clo" - + "ud.bigquery.storage.v1.BatchCommitWriteS" - + "treamsResponse\"<\202\323\344\223\002-\022+/v1/{parent=proj" - + "ects/*/datasets/*/tables/*}\332A\006parent\022\313\001\n" - + "\tFlushRows\0222.google.cloud.bigquery.stora" - + "ge.v1.FlushRowsRequest\0323.google.cloud.bi" - + "gquery.storage.v1.FlushRowsResponse\"U\202\323\344" - + "\223\002@\";/v1/{write_stream=projects/*/datase" - + "ts/*/tables/*/streams/*}:\001*\332A\014write_stre" - + "am\032\260\001\312A\036bigquerystorage.googleapis.com\322A" - + "\213\001https://www.googleapis.com/auth/bigque" - + "ry,https://www.googleapis.com/auth/bigqu" - + "ery.insertdata,https://www.googleapis.co" - + "m/auth/cloud-platformB\235\002\n$com.google.clo" - + "ud.bigquery.storage.v1B\014StorageProtoP\001ZG" - + "google.golang.org/genproto/googleapis/cl" - + "oud/bigquery/storage/v1;storage\252\002 Google" - + ".Cloud.BigQuery.Storage.V1\312\002 Google\\Clou" - + "d\\BigQuery\\Storage\\V1\352AU\n\035bigquery.googl" - + "eapis.com/Table\0224projects/{project}/data" - + "sets/{dataset}/tables/{table}b\006proto3" + + "am\"W\202\323\344\223\002;\"+/v1/{parent=projects/*/datas" + + "ets/*/tables/*}:\014write_stream\332A\023parent,w" + + "rite_stream\022\322\001\n\nAppendRows\0223.google.clou" + + "d.bigquery.storage.v1.AppendRowsRequest\032" + + "4.google.cloud.bigquery.storage.v1.Appen" + + "dRowsResponse\"U\202\323\344\223\002@\";/v1/{write_stream" + + "=projects/*/datasets/*/tables/*/streams/" + + "*}:\001*\332A\014write_stream(\0010\001\022\277\001\n\016GetWriteStr" + + "eam\0227.google.cloud.bigquery.storage.v1.G" + + "etWriteStreamRequest\032-.google.cloud.bigq" + + "uery.storage.v1.WriteStream\"E\202\323\344\223\0028\"3/v1" + + "/{name=projects/*/datasets/*/tables/*/st" + + "reams/*}:\001*\332A\004name\022\331\001\n\023FinalizeWriteStre" + + "am\022<.google.cloud.bigquery.storage.v1.Fi" + + "nalizeWriteStreamRequest\032=.google.cloud." + + "bigquery.storage.v1.FinalizeWriteStreamR" + + "esponse\"E\202\323\344\223\0028\"3/v1/{name=projects/*/da" + + "tasets/*/tables/*/streams/*}:\001*\332A\004name\022\334" + + "\001\n\027BatchCommitWriteStreams\022@.google.clou" + + "d.bigquery.storage.v1.BatchCommitWriteSt" + + "reamsRequest\032A.google.cloud.bigquery.sto" + + "rage.v1.BatchCommitWriteStreamsResponse\"" + + "<\202\323\344\223\002-\022+/v1/{parent=projects/*/datasets" + + "/*/tables/*}\332A\006parent\022\313\001\n\tFlushRows\0222.go" + + "ogle.cloud.bigquery.storage.v1.FlushRows" + + "Request\0323.google.cloud.bigquery.storage." + + "v1.FlushRowsResponse\"U\202\323\344\223\002@\";/v1/{write" + + "_stream=projects/*/datasets/*/tables/*/s" + + "treams/*}:\001*\332A\014write_stream\032\260\001\312A\036bigquer" + + "ystorage.googleapis.com\322A\213\001https://www.g" + + "oogleapis.com/auth/bigquery,https://www." + + "googleapis.com/auth/bigquery.insertdata," + + "https://www.googleapis.com/auth/cloud-pl" + + "atformB\235\002\n$com.google.cloud.bigquery.sto" + + "rage.v1B\014StorageProtoP\001ZGgoogle.golang.o" + + "rg/genproto/googleapis/cloud/bigquery/st" + + "orage/v1;storage\252\002 Google.Cloud.BigQuery" + + ".Storage.V1\312\002 Google\\Cloud\\BigQuery\\Stor" + + "age\\V1\352AU\n\035bigquery.googleapis.com/Table" + + "\0224projects/{project}/datasets/{dataset}/" + + "tables/{table}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -397,7 +411,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_descriptor, new java.lang.String[] { - "WriteStream", "Offset", "ProtoRows", "TraceId", "Rows", + "WriteStream", + "Offset", + "ProtoRows", + "TraceId", + "MissingValueInterpretations", + "Rows", }); internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_ProtoData_descriptor = internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_descriptor @@ -409,6 +428,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "WriterSchema", "Rows", }); + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_descriptor = + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_storage_v1_AppendRowsRequest_MissingValueInterpretationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_cloud_bigquery_storage_v1_AppendRowsResponse_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_bigquery_storage_v1_AppendRowsResponse_fieldAccessorTable = 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 df602135b9..b01ed271ae 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 @@ -417,6 +417,23 @@ message AppendRowsRequest { ProtoRows rows = 2; } + // An enum to indicate how to interpret missing values. Missing values are + // fields present in user schema but missing in rows. A missing value can + // represent a NULL or a column default value defined in BigQuery table + // schema. + enum MissingValueInterpretation { + // Invalid missing value interpretation. Requests with this value will be + // rejected. + MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0; + + // Missing value is interpreted as NULL. + NULL_VALUE = 1; + + // Missing value is interpreted as column default value if declared in the + // table schema, NULL otherwise. + DEFAULT_VALUE = 2; + } + // Required. The write_stream identifies the target of the append operation, and only // needs to be specified as part of the first request on the gRPC connection. // If provided for subsequent requests, it must match the value of the first @@ -454,6 +471,26 @@ message AppendRowsRequest { // Id set by client to annotate its identity. Only initial request setting is // respected. string trace_id = 6; + + // A map to indicate how to interpret missing value for some fields. Missing + // values are fields present in user schema but missing in rows. The key is + // the field name. The value is the interpretation of missing values for the + // field. + // + // For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + // missing values in field foo are interpreted as NULL, all missing values in + // field bar are interpreted as the default value of field bar in table + // schema. + // + // If a field is not in this map and has missing values, the missing values + // in this field are interpreted as NULL. + // + // This field only applies to the current request, it won't affect other + // requests on the connection. + // + // Currently, field name can only be top-level column name, can't be a struct + // field path like 'foo.bar'. + map missing_value_interpretations = 7; } // Response message for `AppendRows`.