We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd8aaae commit bc88aa5Copy full SHA for bc88aa5
1 file changed
google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ProtoSchemaConverter.java
@@ -102,6 +102,17 @@ private static ProtoSchema convertInternal(
102
enumTypes.add(enumFullName);
103
}
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
114
+ resultField.clearOneofIndex();
115
116
resultProto.addField(resultField);
117
118
structTypes.add(protoFullName);
0 commit comments