Skip to content

Conversation

@cxzl25
Copy link
Contributor

@cxzl25 cxzl25 commented Jul 14, 2025

What changes were proposed in this pull request?

This PR aims to fix the mismatch between protoc and protobuf in orc-format module.

Why are the changes needed?

Using ORC 2.1.3, protobuf.GeneratedMessage will output some warning information.

apache/orc#2305

How was this patch tested?

local test

After regenerating orc-format, no warning.

This closes #29

@github-actions github-actions bot added the BUILD label Jul 14, 2025
@cxzl25
Copy link
Contributor Author

cxzl25 commented Jul 31, 2025

cc @dongjoon-hyun @williamhyun

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.25.5</version>
<version>3.25.8</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay.

<maven.compiler.useIncrementalCompilation>false</maven.compiler.useIncrementalCompilation>
<maven.version>3.9.6</maven.version>
<protoc.version>3.17.3</protoc.version>
<protoc.version>3.25.8</protoc.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check if this is compatible or not, @cxzl25 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, this is 25.8 which means 4.25.8.

libprotoc 25.8

@cxzl25
Copy link
Contributor Author

cxzl25 commented Aug 1, 2025

I found a very strange problem
Currently, the Java code generated by release's orc-format 1.1.0 still calls the makeExtensionsImmutable method, but I rebuild orc-format from the source code and will not call makeExtensionsImmutable
Maybe this problem caused the warning.

Current Jar
image

Rebuild Jar

not found makeExtensionsImmutable
image

@dongjoon-hyun
Copy link
Member

Thank you, @cxzl25 . I confirmed the situation of orc-format-1.1.0.jar.

@dongjoon-hyun
Copy link
Member

I verified this PR.

v1.0.0

$ mvn compile -q
Running `/Users/dongjoon/APACHE/orc-format/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc2618445239172123086.exe, --version]
libprotoc 3.17.3
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc2618445239172123086.exe, -I/Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto, --java_out=/Users/dongjoon/APACHE/orc-format/target/generated-sources, /Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto/orc_proto.proto]

$ grep makeExtensionsImmutable target/generated-sources/org/apache/orc/OrcProto.java | wc -l
      33

v1.1.0

$ mvn compile -q
Running `/Users/dongjoon/APACHE/orc-format/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc12009345614848275486.exe, --version]
libprotoc 3.17.3
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc12009345614848275486.exe, -I/Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto, --java_out=/Users/dongjoon/APACHE/orc-format/target/generated-sources, /Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto/orc_proto.proto]

$ grep makeExtensionsImmutable target/generated-sources/org/apache/orc/OrcProto.java | wc -l
      35

main branch

$ mvn compile -q
Running `/Users/dongjoon/APACHE/orc-format/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc14581170830221836816.exe, --version]
libprotoc 3.17.3
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc14581170830221836816.exe, -I/Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto, --java_out=/Users/dongjoon/APACHE/orc-format/target/generated-sources, /Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto/orc_proto.proto]
$ grep makeExtensionsImmutable target/generated-sources/org/apache/orc/OrcProto.java | wc -l
      35

This PR

$ mvn compile -q
Running `/Users/dongjoon/APACHE/orc-format/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc12588362145100533294.exe, --version]
libprotoc 25.8
protoc-jar: executing: [/var/folders/6y/5xv6_jg16jqgfr9qqsplfhb00000gp/T/protoc12588362145100533294.exe, -I/Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto, --java_out=/Users/dongjoon/APACHE/orc-format/target/generated-sources, /Users/dongjoon/APACHE/orc-format/src/main/proto/orc/proto/orc_proto.proto]
$ grep makeExtensionsImmutable target/generated-sources/org/apache/orc/OrcProto.java | wc -l
       0

@dongjoon-hyun
Copy link
Member

The changes look like the following.

diff --git a/pom.xml b/pom.xml
index c90fe59..b48ae00 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
         <maven.compiler.release>17</maven.compiler.release>
         <maven.compiler.useIncrementalCompilation>false</maven.compiler.useIncrementalCompilation>
         <maven.version>3.9.6</maven.version>
-        <protoc.version>3.17.3</protoc.version>
+        <protoc.version>3.25.8</protoc.version>
         <test.tmp.dir>${project.build.directory}/testing-tmp</test.tmp.dir>
     </properties>
 
@@ -69,7 +69,7 @@
         <dependency>
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java</artifactId>
-            <version>3.25.5</version>
+            <version>3.25.8</version>
         </dependency>
     </dependencies>
 
diff --git a/target/generated-sources/org/apache/orc/OrcProto.java b/target/generated-sources/org/apache/orc/OrcProto.java
index 56285af..913e6b2 100644
--- a/target/generated-sources/org/apache/orc/OrcProto.java
+++ b/target/generated-sources/org/apache/orc/OrcProto.java
@@ -1,6 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: orc_proto.proto
 
+// Protobuf Java Version: 3.25.8
 package org.apache.orc;
 
 public final class OrcProto {
@@ -575,64 +576,6 @@ public final class OrcProto {
       return new IntegerStatistics();
     }
 
-    @java.lang.Override
-    public final com.google.protobuf.UnknownFieldSet
-    getUnknownFields() {
-      return this.unknownFields;
-    }
-    private IntegerStatistics(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      this();
-      if (extensionRegistry == null) {
-        throw new java.lang.NullPointerException();
-      }
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
-          com.google.protobuf.UnknownFieldSet.newBuilder();
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            case 8: {
-              bitField0_ |= 0x00000001;
-              minimum_ = input.readSInt64();
-              break;
-            }
-            case 16: {
-              bitField0_ |= 0x00000002;
-              maximum_ = input.readSInt64();
-              break;
-            }
-            case 24: {
-              bitField0_ |= 0x00000004;
-              sum_ = input.readSInt64();
-              break;
-            }
-            default: {
-              if (!parseUnknownField(
-                  input, unknownFields, extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e).setUnfinishedMessage(this);
-      } finally {
-        this.unknownFields = unknownFields.build();
-        makeExtensionsImmutable();
-      }
-    }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
       return org.apache.orc.OrcProto.internal_static_orc_proto_IntegerStatistics_descriptor;
@@ -648,7 +591,7 @@ public final class OrcProto {
 
     private int bitField0_;
     public static final int MINIMUM_FIELD_NUMBER = 1;
-    private long minimum_;
+    private long minimum_ = 0L;
     /**
      * <code>optional sint64 minimum = 1;</code>
      * @return Whether the minimum field is set.
@@ -667,7 +610,7 @@ public final class OrcProto {
     }
 
     public static final int MAXIMUM_FIELD_NUMBER = 2;
-    private long maximum_;
+    private long maximum_ = 0L;
     /**
      * <code>optional sint64 maximum = 2;</code>
      * @return Whether the maximum field is set.
@@ -686,7 +629,7 @@ public final class OrcProto {
     }
 
     public static final int SUM_FIELD_NUMBER = 3;
-    private long sum_;
+    private long sum_ = 0L;
     /**
      * <code>optional sint64 sum = 3;</code>
      * @return Whether the sum field is set.
@@ -727,7 +670,7 @@ public final class OrcProto {
       if (((bitField0_ & 0x00000004) != 0)) {
         output.writeSInt64(3, sum_);
       }
-      unknownFields.writeTo(output);
+      getUnknownFields().writeTo(output);
     }
 
     @java.lang.Override
@@ -748,7 +691,7 @@ public final class OrcProto {
         size += com.google.protobuf.CodedOutputStream
           .computeSInt64Size(3, sum_);
       }
-      size += unknownFields.getSerializedSize();
+      size += getUnknownFields().getSerializedSize();
       memoizedSize = size;
       return size;
     }
@@ -778,7 +721,7 @@ public final class OrcProto {
         if (getSum()
             != other.getSum()) return false;
       }
-      if (!unknownFields.equals(other.unknownFields)) return false;
+      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
       return true;
     }
 
@@ -804,7 +747,7 @@ public final class OrcProto {
         hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
             getSum());
       }
-      hash = (29 * hash) + unknownFields.hashCode();
+      hash = (29 * hash) + getUnknownFields().hashCode();
       memoizedHashCode = hash;
       return hash;
     }
@@ -853,11 +796,13 @@ public final class OrcProto {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input, extensionRegistry);
     }
+
     public static org.apache.orc.OrcProto.IntegerStatistics parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseDelimitedWithIOException(PARSER, input);
     }
+
     public static org.apache.orc.OrcProto.IntegerStatistics parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -921,28 +866,21 @@ public final class OrcProto {
 
       // Construct using org.apache.orc.OrcProto.IntegerStatistics.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
+
       }
 
       private Builder(
           com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         super(parent);
-        maybeForceBuilderInitialization();
-      }
-      private void maybeForceBuilderInitialization() {
-        if (com.google.protobuf.GeneratedMessageV3
-                .alwaysUseFieldBuilders) {
-        }
+
       }
       @java.lang.Override
       public Builder clear() {
         super.clear();
+        bitField0_ = 0;
         minimum_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
         maximum_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000002);
         sum_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
         return this;
       }
 
@@ -969,6 +907,12 @@ public final class OrcProto {
       @java.lang.Override
       public org.apache.orc.OrcProto.IntegerStatistics buildPartial() {
         org.apache.orc.OrcProto.IntegerStatistics result = new org.apache.orc.OrcProto.IntegerStatistics(this);
+        if (bitField0_ != 0) { buildPartial0(result); }
+        onBuilt();
+        return result;
+      }
+
+      private void buildPartial0(org.apache.orc.OrcProto.IntegerStatistics result) {
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) != 0)) {
@@ -983,9 +927,7 @@ public final class OrcProto {
           result.sum_ = sum_;
           to_bitField0_ |= 0x00000004;
         }
-        result.bitField0_ = to_bitField0_;
-        onBuilt();
-        return result;
+        result.bitField0_ |= to_bitField0_;
       }
 
       @java.lang.Override
@@ -1041,7 +983,7 @@ public final class OrcProto {
         if (other.hasSum()) {
           setSum(other.getSum());
         }
-        this.mergeUnknownFields(other.unknownFields);
+        this.mergeUnknownFields(other.getUnknownFields());
         onChanged();
         return this;
       }
@@ -1056,17 +998,45 @@ public final class OrcProto {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        org.apache.orc.OrcProto.IntegerStatistics parsedMessage = null;
+        if (extensionRegistry == null) {
+          throw new java.lang.NullPointerException();
+        }
         try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+          boolean done = false;
+          while (!done) {
+            int tag = input.readTag();
+            switch (tag) {
+              case 0:
+                done = true;
+                break;
+              case 8: {
+                minimum_ = input.readSInt64();
+                bitField0_ |= 0x00000001;
+                break;
+              } // case 8
+              case 16: {
+                maximum_ = input.readSInt64();
+                bitField0_ |= 0x00000002;
+                break;
+              } // case 16
+              case 24: {
+                sum_ = input.readSInt64();
+                bitField0_ |= 0x00000004;
+                break;
+              } // case 24
+              default: {
+                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+                  done = true; // was an endgroup tag
+                }
+                break;
+              } // default:
+            } // switch (tag)
+          } // while (!done)
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.apache.orc.OrcProto.IntegerStatistics) e.getUnfinishedMessage();
           throw e.unwrapIOException();
         } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
+          onChanged();
+        } // finally
         return this;
       }
       private int bitField0_;
@@ -1094,8 +1064,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setMinimum(long value) {
-        bitField0_ |= 0x00000001;
+
         minimum_ = value;
+        bitField0_ |= 0x00000001;
         onChanged();
         return this;
       }
@@ -1133,8 +1104,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setMaximum(long value) {
-        bitField0_ |= 0x00000002;
+
         maximum_ = value;
+        bitField0_ |= 0x00000002;
         onChanged();
         return this;
       }
@@ -1172,8 +1144,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setSum(long value) {
-        bitField0_ |= 0x00000004;
+
         sum_ = value;
+        bitField0_ |= 0x00000004;
         onChanged();
         return this;
       }
@@ -1220,7 +1193,18 @@ public final class OrcProto {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new IntegerStatistics(input, extensionRegistry);
+        Builder builder = newBuilder();
+        try {
+          builder.mergeFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          throw e.setUnfinishedMessage(builder.buildPartial());
+        } catch (com.google.protobuf.UninitializedMessageException e) {
+          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+        } catch (java.io.IOException e) {
+          throw new com.google.protobuf.InvalidProtocolBufferException(e)
+              .setUnfinishedMessage(builder.buildPartial());
+        }
+        return builder.buildPartial();
       }
     };
 
@@ -1299,64 +1283,6 @@ public final class OrcProto {
       return new DoubleStatistics();
     }
 
-    @java.lang.Override
-    public final com.google.protobuf.UnknownFieldSet
-    getUnknownFields() {
-      return this.unknownFields;
-    }
-    private DoubleStatistics(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      this();
-      if (extensionRegistry == null) {
-        throw new java.lang.NullPointerException();
-      }
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
-          com.google.protobuf.UnknownFieldSet.newBuilder();
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            case 9: {
-              bitField0_ |= 0x00000001;
-              minimum_ = input.readDouble();
-              break;
-            }
-            case 17: {
-              bitField0_ |= 0x00000002;
-              maximum_ = input.readDouble();
-              break;
-            }
-            case 25: {
-              bitField0_ |= 0x00000004;
-              sum_ = input.readDouble();
-              break;
-            }
-            default: {
-              if (!parseUnknownField(
-                  input, unknownFields, extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e).setUnfinishedMessage(this);
-      } finally {
-        this.unknownFields = unknownFields.build();
-        makeExtensionsImmutable();
-      }
-    }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
       return org.apache.orc.OrcProto.internal_static_orc_proto_DoubleStatistics_descriptor;
@@ -1372,7 +1298,7 @@ public final class OrcProto {
 
     private int bitField0_;
     public static final int MINIMUM_FIELD_NUMBER = 1;
-    private double minimum_;
+    private double minimum_ = 0D;
     /**
      * <code>optional double minimum = 1;</code>
      * @return Whether the minimum field is set.
@@ -1391,7 +1317,7 @@ public final class OrcProto {
     }
 
     public static final int MAXIMUM_FIELD_NUMBER = 2;
-    private double maximum_;
+    private double maximum_ = 0D;
     /**
      * <code>optional double maximum = 2;</code>
      * @return Whether the maximum field is set.
@@ -1410,7 +1336,7 @@ public final class OrcProto {
     }
 
     public static final int SUM_FIELD_NUMBER = 3;
-    private double sum_;
+    private double sum_ = 0D;
     /**
      * <code>optional double sum = 3;</code>
      * @return Whether the sum field is set.
@@ -1451,7 +1377,7 @@ public final class OrcProto {
       if (((bitField0_ & 0x00000004) != 0)) {
         output.writeDouble(3, sum_);
       }
-      unknownFields.writeTo(output);
+      getUnknownFields().writeTo(output);
     }
 
     @java.lang.Override
@@ -1472,7 +1398,7 @@ public final class OrcProto {
         size += com.google.protobuf.CodedOutputStream
           .computeDoubleSize(3, sum_);
       }
-      size += unknownFields.getSerializedSize();
+      size += getUnknownFields().getSerializedSize();
       memoizedSize = size;
       return size;
     }
@@ -1505,7 +1431,7 @@ public final class OrcProto {
             != java.lang.Double.doubleToLongBits(
                 other.getSum())) return false;
       }
-      if (!unknownFields.equals(other.unknownFields)) return false;
+      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
       return true;
     }
 
@@ -1531,7 +1457,7 @@ public final class OrcProto {
         hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
             java.lang.Double.doubleToLongBits(getSum()));
       }
-      hash = (29 * hash) + unknownFields.hashCode();
+      hash = (29 * hash) + getUnknownFields().hashCode();
       memoizedHashCode = hash;
       return hash;
     }
@@ -1580,11 +1506,13 @@ public final class OrcProto {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input, extensionRegistry);
     }
+
     public static org.apache.orc.OrcProto.DoubleStatistics parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseDelimitedWithIOException(PARSER, input);
     }
+
     public static org.apache.orc.OrcProto.DoubleStatistics parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -1648,28 +1576,21 @@ public final class OrcProto {
 
       // Construct using org.apache.orc.OrcProto.DoubleStatistics.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
+
       }
 
       private Builder(
           com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         super(parent);
-        maybeForceBuilderInitialization();
-      }
-      private void maybeForceBuilderInitialization() {
-        if (com.google.protobuf.GeneratedMessageV3
-                .alwaysUseFieldBuilders) {
-        }
+
       }
       @java.lang.Override
       public Builder clear() {
         super.clear();
+        bitField0_ = 0;
         minimum_ = 0D;
-        bitField0_ = (bitField0_ & ~0x00000001);
         maximum_ = 0D;
-        bitField0_ = (bitField0_ & ~0x00000002);
         sum_ = 0D;
-        bitField0_ = (bitField0_ & ~0x00000004);
         return this;
       }
 
@@ -1696,6 +1617,12 @@ public final class OrcProto {
       @java.lang.Override
       public org.apache.orc.OrcProto.DoubleStatistics buildPartial() {
         org.apache.orc.OrcProto.DoubleStatistics result = new org.apache.orc.OrcProto.DoubleStatistics(this);
+        if (bitField0_ != 0) { buildPartial0(result); }
+        onBuilt();
+        return result;
+      }
+
+      private void buildPartial0(org.apache.orc.OrcProto.DoubleStatistics result) {
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) != 0)) {
@@ -1710,9 +1637,7 @@ public final class OrcProto {
           result.sum_ = sum_;
           to_bitField0_ |= 0x00000004;
         }
-        result.bitField0_ = to_bitField0_;
-        onBuilt();
-        return result;
+        result.bitField0_ |= to_bitField0_;
       }
 
       @java.lang.Override
@@ -1768,7 +1693,7 @@ public final class OrcProto {
         if (other.hasSum()) {
           setSum(other.getSum());
         }
-        this.mergeUnknownFields(other.unknownFields);
+        this.mergeUnknownFields(other.getUnknownFields());
         onChanged();
         return this;
       }
@@ -1783,17 +1708,45 @@ public final class OrcProto {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        org.apache.orc.OrcProto.DoubleStatistics parsedMessage = null;
+        if (extensionRegistry == null) {
+          throw new java.lang.NullPointerException();
+        }
         try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+          boolean done = false;
+          while (!done) {
+            int tag = input.readTag();
+            switch (tag) {
+              case 0:
+                done = true;
+                break;
+              case 9: {
+                minimum_ = input.readDouble();
+                bitField0_ |= 0x00000001;
+                break;
+              } // case 9
+              case 17: {
+                maximum_ = input.readDouble();
+                bitField0_ |= 0x00000002;
+                break;
+              } // case 17
+              case 25: {
+                sum_ = input.readDouble();
+                bitField0_ |= 0x00000004;
+                break;
+              } // case 25
+              default: {
+                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+                  done = true; // was an endgroup tag
+                }
+                break;
+              } // default:
+            } // switch (tag)
+          } // while (!done)
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.apache.orc.OrcProto.DoubleStatistics) e.getUnfinishedMessage();
           throw e.unwrapIOException();
         } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
+          onChanged();
+        } // finally
         return this;
       }
       private int bitField0_;
@@ -1821,8 +1774,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setMinimum(double value) {
-        bitField0_ |= 0x00000001;
+
         minimum_ = value;
+        bitField0_ |= 0x00000001;
         onChanged();
         return this;
       }
@@ -1860,8 +1814,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setMaximum(double value) {
-        bitField0_ |= 0x00000002;
+
         maximum_ = value;
+        bitField0_ |= 0x00000002;
         onChanged();
         return this;
       }
@@ -1899,8 +1854,9 @@ public final class OrcProto {
        * @return This builder for chaining.
        */
       public Builder setSum(double value) {
-        bitField0_ |= 0x00000004;
+
         sum_ = value;
+        bitField0_ |= 0x00000004;
         onChanged();
         return this;
       }
@@ -1947,7 +1903,18 @@ public final class OrcProto {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new DoubleStatistics(input, extensionRegistry);
+        Builder builder = newBuilder();
+        try {
+          builder.mergeFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          throw e.setUnfinishedMessage(builder.buildPartial());
+        } catch (com.google.protobuf.UninitializedMessageException e) {
+          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+        } catch (java.io.IOException e) {
+          throw new com.google.protobuf.InvalidProtocolBufferException(e)
+              .setUnfinishedMessage(builder.buildPartial());
+        }
+        return builder.buildPartial();
       }
     };
 
@@ -2099,78 +2066,6 @@ public final class OrcProto {
       return new StringStatistics();
     }
 
-    @java.lang.Override
-    public final com.google.protobuf.UnknownFieldSet
-    getUnknownFields() {
-      return this.unknownFields;
-    }
-    private StringStatistics(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      this();
-      if (extensionRegistry == null) {
-        throw new java.lang.NullPointerException();
-      }
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
-          com.google.protobuf.UnknownFieldSet.newBuilder();
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              minimum_ = bs;
-              break;
-            }
-            case 18: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000002;
-              maximum_ = bs;
-              break;
-            }
-            case 24: {
-              bitField0_ |= 0x00000004;
-              sum_ = input.readSInt64();
-              break;
-            }
-            case 34: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000008;
-              lowerBound_ = bs;
-              break;
-            }
-            case 42: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000010;
-              upperBound_ = bs;
-              break;
-            }
-            default: {
-              if (!parseUnknownField(
-                  input, unknownFields, extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e).setUnfinishedMessage(this);
-      } finally {
-        this.unknownFields = unknownFields.build();
-        makeExtensionsImmutable();
-      }
-    }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
       return org.apache.orc.OrcProto.internal_static_orc_proto_StringStatistics_descriptor;
@@ -2186,7 +2081,8 @@ public final class OrcProto {
 
     private int bitField0_;
     public static final int MINIMUM_FIELD_NUMBER = 1;
-    private volatile java.lang.Object minimum_;
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object minimum_ = "";
     /**
      * <code>optional string minimum = 1;</code>
      * @return Whether the minimum field is set.
@@ -2234,7 +2130,8 @@ public final class OrcProto {
     }
 
     public static final int MAXIMUM_FIELD_NUMBER = 2;
-    private volatile java.lang.Object maximum_;
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object maximum_ = "";
     /**
      * <code>optional string maximum = 2;</code>
      * @return Whether the maximum field is set.
@@ -2282,7 +2179,7 @@ public final class OrcProto {
     }
 
     public static final int SUM_FIELD_NUMBER = 3;
-    private long sum_;
+    private long sum_ = 0L;
     /**
      * <pre>
      * sum will store the total length of all strings in a stripe
@@ -2309,7 +2206,8 @@ public final class OrcProto {
     }
 
     public static final int LOWER_BOUND_FIELD_NUMBER = 4;
-    private volatile java.lang.Object lowerBound_;
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object lowerBound_ = "";
     /**
      * <pre>
      * If the minimum or maximum value was longer than 1024 bytes, store a lower or upper
@@ -2372,7 +2270,8 @@ public final class OrcProto {
     }
 
     public static final int UPPER_BOUND_FIELD_NUMBER = 5;
-    private volatile java.lang.Object upperBound_;
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object upperBound_ = "";
     /**
      * <code>optional string upper_bound = 5;</code>
      * @return Whether the upperBound field is set.
@@ -2448,7 +2347,7 @@ public final class OrcProto {
       if (((bitField0_ & 0x00000010) != 0)) {
         com.google.protobuf.GeneratedMessageV3.writeString(output, 5, upperBound_);
       }
-      unknownFields.writeTo(output);
+      getUnknownFields().writeTo(output);
     }
 
     @java.lang.Override
@@ -2473,7 +2372,7 @@ public final class OrcProto {
       if (((bitField0_ & 0x00000010) != 0)) {
         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, upperBound_);
       }
-      size += unknownFields.getSerializedSize();
+      size += getUnknownFields().getSerializedSize();
       memoizedSize = size;
       return size;
     }
@@ -2513,7 +2412,7 @@ public final class OrcProto {
         if (!getUpperBound()
             .equals(other.getUpperBound())) return false;
       }
-      if (!unknownFields.equals(other.unknownFields)) return false;
+      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
       return true;
     }
 
@@ -2545,7 +2444,7 @@ public final class OrcProto {
         hash = (37 * hash) + UPPER_BOUND_FIELD_NUMBER;
         hash = (53 * hash) + getUpperBound().hashCode();
       }
-      hash = (29 * hash) + unknownFields.hashCode();
+      hash = (29 * hash) + getUnknownFields().hashCode();
       memoizedHashCode = hash;
       return hash;
     }
@@ -2594,11 +2493,13 @@ public final class OrcProto {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input, extensionRegistry);
     }
+
     public static org.apache.orc.OrcProto.StringStatistics parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseDelimitedWithIOException(PARSER, input);
     }
+
     public static org.apache.orc.OrcProto.StringStatistics parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -2662,32 +2563,23 @@ public final class OrcProto {
 
       // Construct using org.apache.orc.OrcProto.StringStatistics.newBuilder()
       private Builder() {
-        maybeForceBuilderInitialization();
+
       }
 
       private Builder(
           com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         super(parent);
-        maybeForceBuilderInitialization();
-      }
-      private void maybeForceBuilderInitialization() {
-        if (com.google.protobuf.GeneratedMessageV3
-                .alwaysUseFieldBuilders) {
-        }
+
       }
       @java.lang.Override
       public Builder clear() {
         super.clear();
+        bitField0_ = 0;
         minimum_ = "";
-        bitField0_ = (bitField0_ & ~0x00000001);
         maximum_ = "";
-        bitField0_ = (bitField0_ & ~0x00000002);
         sum_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
         lowerBound_ = "";
-        bitField0_ = (bitField0_ & ~0x00000008);
         upperBound_ = "";
-        bitField0_ = (bitField0_ & ~0x00000010);
         return this;
       }
 
@@ -2714,31 +2606,35 @@ public final class OrcProto {
       @java.lang.Override
       public org.apache.orc.OrcProto.StringStatistics buildPartial() {
         org.apache.orc.OrcProto.StringStatistics result = new org.apache.orc.OrcProto.StringStatistics(this);
+        if (bitField0_ != 0) { buildPartial0(result); }
+        onBuilt();
+        return result;
+      }
+
+      private void buildPartial0(org.apache.orc.OrcProto.StringStatistics result) {
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) != 0)) {
+          result.minimum_ = minimum_;
           to_bitField0_ |= 0x00000001;
         }
-        result.minimum_ = minimum_;
         if (((from_bitField0_ & 0x00000002) != 0)) {
+          result.maximum_ = maximum_;
           to_bitField0_ |= 0x00000002;
         }
-        result.maximum_ = maximum_;
         if (((from_bitField0_ & 0x00000004) != 0)) {
           result.sum_ = sum_;
           to_bitField0_ |= 0x00000004;
         }
         if (((from_bitField0_ & 0x00000008) != 0)) {
+          result.lowerBound_ = lowerBound_;
           to_bitField0_ |= 0x00000008;
         }
-        result.lowerBound_ = lowerBound_;
         if (((from_bitField0_ & 0x00000010) != 0)) {
+          result.upperBound_ = upperBound_;
           to_bitField0_ |= 0x00000010;
         }
-        result.upperBound_ = upperBound_;
-        result.bitField0_ = to_bitField0_;
-        onBuilt();
-        return result;
+        result.bitField0_ |= to_bitField0_;
       }
 
       @java.lang.Override
@@ -2786,29 +2682,29 @@ public final class OrcProto {
       public Builder mergeFrom(org.apache.orc.OrcProto.StringStatistics other) {
         if (other == org.apache.orc.OrcProto.StringStatistics.getDefaultInstance()) return this;
         if (other.hasMinimum()) {
-          bitField0_ |= 0x00000001;
           minimum_ = other.minimum_;
+          bitField0_ |= 0x00000001;
           onChanged();
         }
         if (other.hasMaximum()) {
-          bitField0_ |= 0x00000002;
           maximum_ = other.maximum_;
+          bitField0_ |= 0x00000002;
           onChanged();
         }
         if (other.hasSum()) {
           setSum(other.getSum());
         }
         if (other.hasLowerBound()) {
-          bitField0_ |= 0x00000008;
           lowerBound_ = other.lowerBound_;
+          bitField0_ |= 0x00000008;
           onChanged();
         }
         if (other.hasUpperBound()) {
-          bitField0_ |= 0x00000010;
           upperBound_ = other.upperBound_;
+          bitField0_ |= 0x00000010;
           onChanged();
         }
-        this.mergeUnknownFields(other.unknownFields);
+        this.mergeUnknownFields(other.getUnknownFields());
         onChanged();
         return this;
       }
@@ -2823,17 +2719,55 @@ public final class OrcProto {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        org.apache.orc.OrcProto.StringStatistics parsedMessage = null;
+        if (extensionRegistry == null) {
+          throw new java.lang.NullPointerException();
+        }
         try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+          boolean done = false;
+          while (!done) {
+            int tag = input.readTag();
+            switch (tag) {
+              case 0:
+                done = true;
+                break;
+              case 10: {
+                minimum_ = input.readBytes();
+                bitField0_ |= 0x00000001;
+                break;
+              } // case 10
+              case 18: {
+                maximum_ = input.readBytes();
+                bitField0_ |= 0x00000002;
+                break;
+              } // case 18
+              case 24: {
+                sum_ = input.readSInt64();
+                bitField0_ |= 0x00000004;
+                break;
+              } // case 24
+              case 34: {
+                lowerBound_ = input.readBytes();
+                bitField0_ |= 0x00000008;
+                break;
+              } // case 34
+              case 42: {
+                upperBound_ = input.readBytes();
+                bitField0_ |= 0x00000010;
+                break;
+              } // case 42
+              default: {
+                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+                  done = true; // was an endgroup tag
+                }
+                break;
+              } // default:
...

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we overlooked this mismatch before because @ekpdt 's suggestion.

@dongjoon-hyun dongjoon-hyun changed the title Upgrade protoc and protobuf version to 3.25.8 ORC-FORMAT-29: Upgrade protoc and protobuf-java to 3.25.8 Aug 13, 2025
@dongjoon-hyun dongjoon-hyun added this to the 1.2.0 milestone Aug 13, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @cxzl25 .

@dongjoon-hyun dongjoon-hyun merged commit 654dd3f into apache:main Aug 13, 2025
2 checks passed
@dongjoon-hyun dongjoon-hyun modified the milestones: 1.2.0, 1.1.1 Aug 13, 2025
@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Aug 13, 2025

This is backported to branch-1.1 too.

@cxzl25
Copy link
Contributor Author

cxzl25 commented Aug 14, 2025

Thanks @dongjoon-hyun

dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Aug 19, 2025
### What changes were proposed in this pull request?
This PR aims to upgrade ORC format to 1.1.1.

### Why are the changes needed?
This will bring the latest bug fixes.
https://github.com/apache/orc-format/milestone/4?closed=1
- apache/orc-format#28

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #52069 from williamhyun/orc-format-1.1.1.

Authored-by: William Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Aug 19, 2025
This PR aims to upgrade ORC format to 1.1.1.

This will bring the latest bug fixes.
https://github.com/apache/orc-format/milestone/4?closed=1
- apache/orc-format#28

No.

Pass the CIs.

No.

Closes #52069 from williamhyun/orc-format-1.1.1.

Authored-by: William Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit d2e550f)
Signed-off-by: Dongjoon Hyun <[email protected]>
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
This PR aims to upgrade ORC format to 1.1.1.

This will bring the latest bug fixes.
https://github.com/apache/orc-format/milestone/4?closed=1
- apache/orc-format#28

No.

Pass the CIs.

No.

Closes apache#52069 from williamhyun/orc-format-1.1.1.

Authored-by: William Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 8b50e72)
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade protoc and protobuf version to 3.25.8

2 participants