Skip to content

Commit 3abe516

Browse files
HIVE-28803: Persist writeId as -1 instead of 0 during alter operation (#5685)
1 parent 0f83959 commit 3abe516

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,9 @@ public List<Object[]> run(List<String> input) throws Exception {
569569
useOldWriteId = false;
570570
}
571571
}
572-
573-
if (useOldWriteId) {
572+
// writeId default in the DB is 0 but in the application logic it is set to -1.
573+
// HIVE-28803 is changing the writeId from -1 to 0 during alter query which is undesirable
574+
if (useOldWriteId && partIdToWriteId.get(partId) != 0) {
574575
newPart.setWriteId(partIdToWriteId.get(partId));
575576
}
576577
}

0 commit comments

Comments
 (0)