BQ Protobuf Options
Copyright 2014 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Message containing options related to BigQuery schema generation and management via Protobuf.
Field | Type | Label | Description |
---|---|---|---|
require | bool | Flag to specify that a field should be marked as 'REQUIRED' when used to generate schema for BigQuery. | |
type_override | string | ||
ignore | bool | Optionally omit a field from BigQuery schema. | |
description | string | Set the description for a field in BigQuery schema. | |
name | string | Customize the name of the field in the BigQuery schema. | |
policy_tags | string | Optionally add PolicyTag for a field in BigQuery schema. |
Extension | Type | Base | Number | Description |
---|---|---|---|---|
bigquery | BigQueryFieldOptions | .google.protobuf.FieldOptions | 1021 | BigQuery field schema generation options. |
Field | Type | Label | Description |
---|---|---|---|
table_name | string | Specifies a name of table in BigQuery for the message. |
If not blank, indicates the message is a type of record to be stored into BigQuery. | | use_json_names | bool | | If true, BigQuery field names will default to a field's JSON name, not its original/proto field name. | | extra_fields | string | repeated | If set, adds defined extra fields to a JSON representation of the message. Value format: "<field name>:<BigQuery field type>" for basic types or "<field name>:RECORD:<protobuf type>" for message types. "NULLABLE" by default, different mode may be set via optional suffix ":<mode>" |
Extension | Type | Base | Number | Description |
---|---|---|---|---|
bigquery_opts | BigQueryMessageOptions | .google.protobuf.MessageOptions | 1021 | NB: There used to be a custom option named "table_name". But only one tag is registered for this project: 1021. So when adding other options, the only solution was to change tag 1021 to be a message, with all the various options as fields therein. |
If you are upgrading this library and find that protoc begins to reject your proto files, you'll need to change all lines that look like so: option (gen_bq_schema.table_name) = "foo"; to instead look like this: option (gen_bq_schema.bigquery_opts).table_name = "foo"; There was no backwards compatible way to make this change. Sorry for the inconvenience. BigQuery message schema generation options.
The field number is a globally unique id for this option, assigned by protobuf-global-extension-registry@google.com |