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

gsaihemanth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 3abe51670c6 HIVE-28803: Persist writeId as -1 instead of 0 during 
alter operation (#5685)
3abe51670c6 is described below

commit 3abe51670c608c43b6ea6ff2f7268802fbf73372
Author: Sai Hemanth Gantasala 
<[email protected]>
AuthorDate: Fri Mar 14 09:39:55 2025 -0700

    HIVE-28803: Persist writeId as -1 instead of 0 during alter operation 
(#5685)
---
 .../java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
 
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index 3768680fc98..9869297c786 100644
--- 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++ 
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -569,8 +569,9 @@ public List<Object[]> run(List<String> input) throws 
Exception {
           useOldWriteId = false;
         }
       }
-
-      if (useOldWriteId) {
+      // writeId default in the DB is 0 but in the application logic it is set 
to -1.
+      // HIVE-28803 is changing the writeId from -1 to 0 during alter query 
which is undesirable
+      if (useOldWriteId && partIdToWriteId.get(partId) != 0) {
         newPart.setWriteId(partIdToWriteId.get(partId));
       }
     }

Reply via email to