justaparth commented on code in PR #40686: URL: https://github.com/apache/spark/pull/40686#discussion_r1179249860
########## connector/protobuf/src/test/resources/protobuf/proto3_optional.proto: ########## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ +// To compile the descriptor: +// cd connector/protobuf/src/test/resources/protobuf +// protoc --include_imports --descriptor_set_out=proto3_optional.desc proto3_optional.proto + +syntax = "proto3"; + +package org.apache.spark.sql.protobuf.protos; + +option java_outer_classname = "Proto3Optional"; + +message TestMessage { + int32 bar = 1; + optional int32 baz = 2; Review Comment: yeah, so `optional` added in proto 3.15 has field presence information, so when we read a serialized proto with an optional field we can know whether the field was written to or not. I didn't see an example of this in the existing tests, so I wanted to test it out to make sure my modifications would do the right thing for a field like this. i'll combine it as you mentioned above into a different file -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
