uwemaurer commented on code in PR #3352:
URL: https://github.com/apache/parquet-java/pull/3352#discussion_r2464130839


##########
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java:
##########
@@ -445,10 +445,13 @@ final void writeField(Object value) {
 
     private void writeAllFields(MessageOrBuilder pb) {
       Descriptor messageDescriptor = pb.getDescriptorForType();
-      Descriptors.FileDescriptor.Syntax syntax =
-          messageDescriptor.getFile().getSyntax();
+      String syntax = messageDescriptor.getFile().toProto().getSyntax();
+      if ("editions".equals(syntax)) {
+        throw new UnsupportedOperationException("protocol buffers 'editions' 
not supported");
+      }
+      boolean isProto2 = !"proto3".equals(syntax);

Review Comment:
   I wanted to keep the logic the same as in the protobuf library (v4), they 
have this code:
   ```
    Edition getEdition() {
         switch (proto.getSyntax()) {
           case "editions":
             return proto.getEdition();
           case "proto3":
             return Edition.EDITION_PROTO3;
           default:
             return Edition.EDITION_PROTO2;
         }
       }
   ```
   
   In my tests the value of `syntax` was the empty string (not `proto2`) for 
proto2 files, this is why it just compares against `editions` and `proto3`.



-- 
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]

Reply via email to