This is an automated email from the ASF dual-hosted git repository.
dkuzmenko 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 9002abaf7d5 HIVE-28622: Duplicate Entries in
TXN_WRITE_NOTIFICATION_LOG Due to Oracle's Handling of Empty Strings (Harshal
Patel, reviewed by Denys Kuzmenko, Teddy Choi)
9002abaf7d5 is described below
commit 9002abaf7d5b8c45a8fdc949de1fc46c08c592d3
Author: harshal-16 <[email protected]>
AuthorDate: Sat Feb 8 19:23:00 2025 +0530
HIVE-28622: Duplicate Entries in TXN_WRITE_NOTIFICATION_LOG Due to Oracle's
Handling of Empty Strings (Harshal Patel, reviewed by Denys Kuzmenko, Teddy
Choi)
Closes #5617
---
.../org/apache/hive/hcatalog/listener/DbNotificationListener.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
b/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
index 7262e7f873e..7636d646da6 100644
---
a/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
+++
b/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
@@ -1205,7 +1205,7 @@ private void
addWriteNotificationLog(List<NotificationEvent> eventBatch, List<Ac
String select = sqlGenerator.addForUpdateClause("select \"WNL_ID\",
\"WNL_FILES\" from" +
" \"TXN_WRITE_NOTIFICATION_LOG\" " +
"where \"WNL_DATABASE\" = ? " +
- "and \"WNL_TABLE\" = ? " + " and \"WNL_PARTITION\" = ? " +
+ "and \"WNL_TABLE\" = ? " + " and (\"WNL_PARTITION\" = ? OR (? IS
NULL AND \"WNL_PARTITION\" IS NULL)) " +
"and \"WNL_TXNID\" = ? ");
List<Integer> insertList = new ArrayList<>();
Map<Integer, Pair<Long, String>> updateMap = new HashMap<>();
@@ -1221,7 +1221,8 @@ private void
addWriteNotificationLog(List<NotificationEvent> eventBatch, List<Ac
pst.setString(1, dbName);
pst.setString(2, tblName);
pst.setString(3, partition);
- pst.setLong(4, txnId);
+ pst.setString(4, partition);
+ pst.setLong(5, txnId);
rs = pst.executeQuery();
if (!rs.next()) {
insertList.add(i);