diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1f550b0..8b03463 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,8 +21,6 @@ jobs: uses: actions/checkout@v2 - name: Install protoc uses: arduino/setup-protoc@v1 - - name: Install protoc-gen-go - run: go get -u github.com/golang/protobuf/protoc-gen-go # Formatting, go mod tidy, and re-generate proto extension code - name: Run go fmt on all modules diff --git a/bq_table.proto b/bq_table.proto index b4f8759..c33cb9b 100644 --- a/bq_table.proto +++ b/bq_table.proto @@ -56,4 +56,11 @@ message BigQueryMessageOptions { // or ":RECORD:" for message types. // "NULLABLE" by default, different mode may be set via optional suffix ":" repeated string extra_fields = 3; + + // If set will output the schema file order based on the provided value. + enum FieldOrder { + FIELD_ORDER_UNSPECIFIED = 0; + FIELD_ORDER_BY_NUMBER = 1; + } + FieldOrder output_field_order = 4; } \ No newline at end of file diff --git a/pkg/converter/convert.go b/pkg/converter/convert.go index cc44801..67d0f5f 100644 --- a/pkg/converter/convert.go +++ b/pkg/converter/convert.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "path" + "sort" "strings" "github.com/GoogleCloudPlatform/protoc-gen-bq-schema/protos" @@ -274,7 +275,14 @@ func convertMessageType( } parentMessages[msg] = true - for fieldIndex, fieldDesc := range msg.GetField() { + fields := msg.GetField() + // Sort fields by the field numbers if the option is set. + if opts.GetOutputFieldOrder() == protos.BigQueryMessageOptions_FIELD_ORDER_BY_NUMBER { + sort.Slice(fields, func(i, j int) bool { + return fields[i].GetNumber() < fields[j].GetNumber() + }) + } + for fieldIndex, fieldDesc := range fields { fieldCommentPath := fmt.Sprintf("%s.%d.%d", path, fieldPath, fieldIndex) field, err := convertField(curPkg, fieldDesc, opts, parentMessages, comments, fieldCommentPath) if err != nil { diff --git a/pkg/converter/plugin_test.go b/pkg/converter/plugin_test.go index e388a7d..27e6f0b 100644 --- a/pkg/converter/plugin_test.go +++ b/pkg/converter/plugin_test.go @@ -504,3 +504,154 @@ func TestExtraFields(t *testing.T) { ]`, }) } + +func TestOrderSchemaByFieldNumber(t *testing.T) { + testConvert(t, ` + file_to_generate: "foo.proto" + proto_file < + name: "foo.proto" + package: "example_package.nested" + message_type < + name: "FooProto" + field < name: "first" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "third" number: 3 type: TYPE_INT32 label: LABEL_REQUIRED > + field < name: "second" number: 2 type: TYPE_INT32 label: LABEL_REPEATED > + options < [gen_bq_schema.bigquery_opts] < + table_name: "foo_table" + output_field_order: 1 + > + > + > + > + `, + map[string]string{ + "example_package/nested/foo_table.schema": `[ + { "name": "first", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "second", "type": "INTEGER", "mode": "REPEATED" }, + { "name": "third", "type": "INTEGER", "mode": "REQUIRED" } + ]`, + }) +} + +func TestNestedOrderSchemaByFieldNumber(t *testing.T) { + testConvert(t, ` + file_to_generate: "foo.proto" + proto_file < + name: "foo.proto" + package: "example_package" + message_type < + name: "FooProto" + field < name: "f_1" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "f_3" number: 3 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < + name: "bar" + number: 2 + type: TYPE_MESSAGE + label: LABEL_OPTIONAL + type_name: "BarProto" + > + options < [gen_bq_schema.bigquery_opts] < + table_name: "foo_table" + output_field_order: 1 + > + > + > + message_type < + name: "BarProto" + field < name: "b_2" number: 2 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_3" number: 3 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_1" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + options < [gen_bq_schema.bigquery_opts] < + output_field_order: 1 + > + > + > + > + `, + map[string]string{ + "example_package/foo_table.schema": `[ + { "name": "f_1", "type": "INTEGER", "mode": "NULLABLE" }, + { + "name": "bar", "type": "RECORD", "mode": "NULLABLE", + "fields": [ + { "name": "b_1", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_2", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_3", "type": "INTEGER", "mode": "NULLABLE" } + ] + }, + { "name": "f_3", "type": "INTEGER", "mode": "NULLABLE" } + ]`, + }) +} + +func TestMultipleMessageOrderByFieldNumber(t *testing.T) { + testConvert(t, ` + file_to_generate: "foo.proto" + proto_file < + name: "foo.proto" + package: "example_package" + message_type < + name: "FooProto" + field < name: "f_1" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "f_3" number: 4 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < + name: "bar_ordered" + number: 2 + type: TYPE_MESSAGE + label: LABEL_OPTIONAL + type_name: "BarOrderedProto" + > + field < + name: "bar_unordered" + number: 3 + type: TYPE_MESSAGE + label: LABEL_OPTIONAL + type_name: "BarUnOrderedProto" + > + options < [gen_bq_schema.bigquery_opts] < + table_name: "foo_table" + output_field_order: 1 + > + > + > + message_type < + name: "BarOrderedProto" + field < name: "b_2" number: 2 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_3" number: 3 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_1" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + options < [gen_bq_schema.bigquery_opts] < + output_field_order: 1 + > + > + > + message_type < + name: "BarUnOrderedProto" + field < name: "b_2" number: 2 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_3" number: 3 type: TYPE_INT32 label: LABEL_OPTIONAL > + field < name: "b_1" number: 1 type: TYPE_INT32 label: LABEL_OPTIONAL > + > + > + `, + map[string]string{ + "example_package/foo_table.schema": `[ + { "name": "f_1", "type": "INTEGER", "mode": "NULLABLE" }, + { + "name": "bar_ordered", "type": "RECORD", "mode": "NULLABLE", + "fields": [ + { "name": "b_1", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_2", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_3", "type": "INTEGER", "mode": "NULLABLE" } + ] + }, + { + "name": "bar_unordered", "type": "RECORD", "mode": "NULLABLE", + "fields": [ + { "name": "b_2", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_3", "type": "INTEGER", "mode": "NULLABLE" }, + { "name": "b_1", "type": "INTEGER", "mode": "NULLABLE" } + ] + }, + { "name": "f_3", "type": "INTEGER", "mode": "NULLABLE" } + ]`, + }) +} diff --git a/protos/bq_field.pb.go b/protos/bq_field.pb.go index 850dcda..0da75f2 100644 --- a/protos/bq_field.pb.go +++ b/protos/bq_field.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.19.3 +// protoc-gen-go v1.31.0 +// protoc v3.21.12 // source: bq_field.proto package protos @@ -178,8 +178,11 @@ var file_bq_field_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x18, 0xfd, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x62, 0x71, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x08, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2e, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x62, 0x71, 0x2d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protos/bq_table.pb.go b/protos/bq_table.pb.go index aa0340e..e008187 100644 --- a/protos/bq_table.pb.go +++ b/protos/bq_table.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.19.3 +// protoc-gen-go v1.31.0 +// protoc v3.21.12 // source: bq_table.proto package protos @@ -35,6 +35,53 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// If set will output the schema file order based on the provided value. +type BigQueryMessageOptions_FieldOrder int32 + +const ( + BigQueryMessageOptions_FIELD_ORDER_UNSPECIFIED BigQueryMessageOptions_FieldOrder = 0 + BigQueryMessageOptions_FIELD_ORDER_BY_NUMBER BigQueryMessageOptions_FieldOrder = 1 +) + +// Enum value maps for BigQueryMessageOptions_FieldOrder. +var ( + BigQueryMessageOptions_FieldOrder_name = map[int32]string{ + 0: "FIELD_ORDER_UNSPECIFIED", + 1: "FIELD_ORDER_BY_NUMBER", + } + BigQueryMessageOptions_FieldOrder_value = map[string]int32{ + "FIELD_ORDER_UNSPECIFIED": 0, + "FIELD_ORDER_BY_NUMBER": 1, + } +) + +func (x BigQueryMessageOptions_FieldOrder) Enum() *BigQueryMessageOptions_FieldOrder { + p := new(BigQueryMessageOptions_FieldOrder) + *p = x + return p +} + +func (x BigQueryMessageOptions_FieldOrder) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BigQueryMessageOptions_FieldOrder) Descriptor() protoreflect.EnumDescriptor { + return file_bq_table_proto_enumTypes[0].Descriptor() +} + +func (BigQueryMessageOptions_FieldOrder) Type() protoreflect.EnumType { + return &file_bq_table_proto_enumTypes[0] +} + +func (x BigQueryMessageOptions_FieldOrder) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BigQueryMessageOptions_FieldOrder.Descriptor instead. +func (BigQueryMessageOptions_FieldOrder) EnumDescriptor() ([]byte, []int) { + return file_bq_table_proto_rawDescGZIP(), []int{0, 0} +} + type BigQueryMessageOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -51,7 +98,8 @@ type BigQueryMessageOptions struct { // Value format: ":" for basic types // or ":RECORD:" for message types. // "NULLABLE" by default, different mode may be set via optional suffix ":" - ExtraFields []string `protobuf:"bytes,3,rep,name=extra_fields,json=extraFields,proto3" json:"extra_fields,omitempty"` + ExtraFields []string `protobuf:"bytes,3,rep,name=extra_fields,json=extraFields,proto3" json:"extra_fields,omitempty"` + OutputFieldOrder BigQueryMessageOptions_FieldOrder `protobuf:"varint,4,opt,name=output_field_order,json=outputFieldOrder,proto3,enum=gen_bq_schema.BigQueryMessageOptions_FieldOrder" json:"output_field_order,omitempty"` } func (x *BigQueryMessageOptions) Reset() { @@ -107,6 +155,13 @@ func (x *BigQueryMessageOptions) GetExtraFields() []string { return nil } +func (x *BigQueryMessageOptions) GetOutputFieldOrder() BigQueryMessageOptions_FieldOrder { + if x != nil { + return x.OutputFieldOrder + } + return BigQueryMessageOptions_FIELD_ORDER_UNSPECIFIED +} + var file_bq_table_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptor.MessageOptions)(nil), @@ -136,7 +191,7 @@ var file_bq_table_proto_rawDesc = []byte{ 0x12, 0x0d, 0x67, 0x65, 0x6e, 0x5f, 0x62, 0x71, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x16, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, + 0x6f, 0x22, 0xa6, 0x02, 0x0a, 0x16, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x75, @@ -144,15 +199,28 @@ var file_bq_table_proto_rawDesc = []byte{ 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x3a, 0x6c, 0x0a, 0x0d, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x5f, 0x6f, 0x70, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfd, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x67, 0x65, 0x6e, 0x5f, 0x62, 0x71, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x69, - 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0c, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, - 0x74, 0x73, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6c, 0x64, 0x73, 0x12, 0x5e, 0x0a, 0x12, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x30, 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x62, 0x71, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x2e, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x22, 0x44, 0x0a, 0x0a, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x19, 0x0a, 0x15, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, + 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x3a, 0x6c, 0x0a, 0x0d, 0x62, 0x69, + 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x6f, 0x70, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfd, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x62, 0x71, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0c, 0x62, 0x69, 0x67, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x73, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x62, 0x71, 0x2d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -167,19 +235,22 @@ func file_bq_table_proto_rawDescGZIP() []byte { return file_bq_table_proto_rawDescData } +var file_bq_table_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_bq_table_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_bq_table_proto_goTypes = []interface{}{ - (*BigQueryMessageOptions)(nil), // 0: gen_bq_schema.BigQueryMessageOptions - (*descriptor.MessageOptions)(nil), // 1: google.protobuf.MessageOptions + (BigQueryMessageOptions_FieldOrder)(0), // 0: gen_bq_schema.BigQueryMessageOptions.FieldOrder + (*BigQueryMessageOptions)(nil), // 1: gen_bq_schema.BigQueryMessageOptions + (*descriptor.MessageOptions)(nil), // 2: google.protobuf.MessageOptions } var file_bq_table_proto_depIdxs = []int32{ - 1, // 0: gen_bq_schema.bigquery_opts:extendee -> google.protobuf.MessageOptions - 0, // 1: gen_bq_schema.bigquery_opts:type_name -> gen_bq_schema.BigQueryMessageOptions - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: gen_bq_schema.BigQueryMessageOptions.output_field_order:type_name -> gen_bq_schema.BigQueryMessageOptions.FieldOrder + 2, // 1: gen_bq_schema.bigquery_opts:extendee -> google.protobuf.MessageOptions + 1, // 2: gen_bq_schema.bigquery_opts:type_name -> gen_bq_schema.BigQueryMessageOptions + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 2, // [2:3] is the sub-list for extension type_name + 1, // [1:2] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_bq_table_proto_init() } @@ -206,13 +277,14 @@ func file_bq_table_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_bq_table_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 1, NumExtensions: 1, NumServices: 0, }, GoTypes: file_bq_table_proto_goTypes, DependencyIndexes: file_bq_table_proto_depIdxs, + EnumInfos: file_bq_table_proto_enumTypes, MessageInfos: file_bq_table_proto_msgTypes, ExtensionInfos: file_bq_table_proto_extTypes, }.Build()