Commit bc88aa5 1 parent fd8aaae commit bc88aa5 Copy full SHA for bc88aa5
File tree 1 file changed +11
-0
lines changed
google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,17 @@ private static ProtoSchema convertInternal(
102
102
enumTypes .add (enumFullName );
103
103
}
104
104
}
105
+ // The protobuf payload will be decoded as proto2 on the server side. The schema is also
106
+ // specified as proto2. Hence we must clear proto3-only features. This works since proto2 and
107
+ // proto3 are binary-compatible.
108
+ if (resultField .hasProto3Optional ()) {
109
+ // Clear proto3-only features
110
+ resultField .clearProto3Optional ();
111
+ }
112
+ if (resultField .hasOneofIndex ()) {
113
+ // Clear proto3-only features
114
+ resultField .clearOneofIndex ();
115
+ }
105
116
resultProto .addField (resultField );
106
117
}
107
118
structTypes .add (protoFullName );
You can’t perform that action at this time.
0 commit comments