Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add use_table_schema field to BigQueryConfig #1838

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-pubsub'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-pubsub:1.125.12'
implementation 'com.google.cloud:google-cloud-pubsub:1.125.13'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.125.12"
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.125.13"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -409,7 +409,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.125.12
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.125.13
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ public com.google.protobuf.ByteString getTableBytes() {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand Down Expand Up @@ -431,6 +432,26 @@ public com.google.pubsub.v1.BigQueryConfig.State getState() {
return result == null ? com.google.pubsub.v1.BigQueryConfig.State.UNRECOGNIZED : result;
}

public static final int USE_TABLE_SCHEMA_FIELD_NUMBER = 6;
private boolean useTableSchema_ = false;
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
@java.lang.Override
public boolean getUseTableSchema() {
return useTableSchema_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -460,6 +481,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
output.writeEnum(5, state_);
}
if (useTableSchema_ != false) {
output.writeBool(6, useTableSchema_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -484,6 +508,9 @@ public int getSerializedSize() {
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_);
}
if (useTableSchema_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -504,6 +531,7 @@ public boolean equals(final java.lang.Object obj) {
if (getWriteMetadata() != other.getWriteMetadata()) return false;
if (getDropUnknownFields() != other.getDropUnknownFields()) return false;
if (state_ != other.state_) return false;
if (getUseTableSchema() != other.getUseTableSchema()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -525,6 +553,8 @@ public int hashCode() {
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDropUnknownFields());
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -668,6 +698,7 @@ public Builder clear() {
writeMetadata_ = false;
dropUnknownFields_ = false;
state_ = 0;
useTableSchema_ = false;
return this;
}

Expand Down Expand Up @@ -718,6 +749,9 @@ private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) {
if (((from_bitField0_ & 0x00000010) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.useTableSchema_ = useTableSchema_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -782,6 +816,9 @@ public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) {
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (other.getUseTableSchema() != false) {
setUseTableSchema(other.getUseTableSchema());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -838,6 +875,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000010;
break;
} // case 40
case 48:
{
useTableSchema_ = input.readBool();
bitField0_ |= 0x00000020;
break;
} // case 48
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -973,11 +1016,12 @@ public Builder setTableBytes(com.google.protobuf.ByteString value) {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand All @@ -989,11 +1033,12 @@ public boolean getUseTopicSchema() {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useTopicSchema to set.
* @return This builder for chaining.
Expand All @@ -1009,11 +1054,12 @@ public Builder setUseTopicSchema(boolean value) {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
Expand Down Expand Up @@ -1259,6 +1305,65 @@ public Builder clearState() {
return this;
}

private boolean useTableSchema_;
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
@java.lang.Override
public boolean getUseTableSchema() {
return useTableSchema_;
}
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useTableSchema to set.
* @return This builder for chaining.
*/
public Builder setUseTableSchema(boolean value) {

useTableSchema_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearUseTableSchema() {
bitField0_ = (bitField0_ & ~0x00000020);
useTableSchema_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ public interface BigQueryConfigOrBuilder
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand Down Expand Up @@ -128,4 +129,19 @@ public interface BigQueryConfigOrBuilder
* @return The state.
*/
com.google.pubsub.v1.BigQueryConfig.State getState();

/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
boolean getUseTableSchema();
}
Loading
Loading