[ 
https://issues.apache.org/jira/browse/HIVE-26285?focusedWorklogId=779549&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-779549
 ]

ASF GitHub Bot logged work on HIVE-26285:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Jun/22 15:23
            Start Date: 08/Jun/22 15:23
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on code in PR #3346:
URL: https://github.com/apache/hive/pull/3346#discussion_r892526196


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java:
##########
@@ -739,6 +741,23 @@ private int executeIncrementalLoad(long loadStartTime) 
throws Exception {
         LOG.info("Dropping table {} for optimised bootstarap", 
work.dbNameToLoadIn + "." + table);
         db.dropTable(work.dbNameToLoadIn + "." + table, true);
       }
+      Database sourceDb = getSourceDbMetadata();  //This sourceDb was the 
actual target prior to failover.
+      Map<String, String> sourceDbProps = sourceDb.getParameters();
+      List<String> replicationProps = MetaStoreUtils.getReplicationDbProps(); 
//Replication Props will be handled separately as part of preAckTask.
+      for (Map.Entry<String, String> currProp : 
targetDb.getParameters().entrySet()) {
+        String actualVal = sourceDbProps.get(currProp.getKey());
+        if (!replicationProps.contains(currProp.getKey()) && 
!currProp.getValue().equals(actualVal)) {

Review Comment:
   can't we filter the map (targetDb.getParameters()) with replicationProps 
first to avoid the lookups?
   ````
       replicationProps.stream()
                 .map(targetDb.getParameters()::get)
                 .filter(Objects::isNull)
                  ....
   ````





Issue Time Tracking
-------------------

    Worklog Id:     (was: 779549)
    Time Spent: 1h  (was: 50m)

> Overwrite database metadata on original source in optimised failover.
> ---------------------------------------------------------------------
>
>                 Key: HIVE-26285
>                 URL: https://issues.apache.org/jira/browse/HIVE-26285
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Haymant Mangla
>            Assignee: Haymant Mangla
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to