This is an automated email from the ASF dual-hosted git repository.

satish pushed a commit to branch release-0.12.2
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 1db97a8ae7bd764b3924ed798e4ca939a310e950
Author: Alexander Trushev <[email protected]>
AuthorDate: Wed Nov 30 09:54:35 2022 +0700

    [MINOR] Reuse empty InternalSchema instance (#7287)
---
 .../src/main/java/org/apache/hudi/internal/schema/InternalSchema.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/hudi-common/src/main/java/org/apache/hudi/internal/schema/InternalSchema.java 
b/hudi-common/src/main/java/org/apache/hudi/internal/schema/InternalSchema.java
index 659612cd5cf..c38d120ae8f 100644
--- 
a/hudi-common/src/main/java/org/apache/hudi/internal/schema/InternalSchema.java
+++ 
b/hudi-common/src/main/java/org/apache/hudi/internal/schema/InternalSchema.java
@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
 public class InternalSchema implements Serializable {
 
   private static final long DEFAULT_VERSION_ID = 0;
+  private static final InternalSchema EMPTY_SCHEMA = new InternalSchema(-1L, 
new ArrayList<>());
 
   private final RecordType record;
 
@@ -51,7 +52,7 @@ public class InternalSchema implements Serializable {
   private transient Map<Integer, String> idToName = null;
 
   public static InternalSchema getEmptyInternalSchema() {
-    return new InternalSchema(-1L, new ArrayList<>());
+    return EMPTY_SCHEMA;
   }
 
   public boolean isEmptySchema() {

Reply via email to