sankarh commented on a change in pull request #541: HIVE-21197 : Hive 
Replication can add duplicate data during migration to a target with 
hive.strict.managed.tables enabled
URL: https://github.com/apache/hive/pull/541#discussion_r259739884
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
 ##########
 @@ -5199,6 +5205,35 @@ public static boolean doesTableNeedLocation(Table tbl) {
     return retval;
   }
 
+  private int updateFirstIncPendingFlag(Hive hive, ReplSetFirstIncLoadFlagDesc 
desc) throws HiveException, TException {
+    String dbNameOrPattern = desc.getDatabaseName();
+    String tableNameOrPattern = desc.getTableName();
+    String flag = desc.getIncLoadPendingFlag() ? "true" : "false";
+    Map<String, String> parameters;
+    // For database level load tableNameOrPattern will be null. Flag is set 
only in database for db level load.
+    if (tableNameOrPattern != null && !tableNameOrPattern.isEmpty()) {
+      // For table level load, dbNameOrPattern is db name and not a pattern.
+      for (String tableName : Utils.matchesTbl(hive, dbNameOrPattern, 
tableNameOrPattern)) {
+        org.apache.hadoop.hive.metastore.api.Table tbl = 
hive.getMSC().getTable(dbNameOrPattern, tableName);
+        parameters = tbl.getParameters();
+        if (ReplUtils.isFirstIncPending(parameters)) {
 
 Review comment:
   Why do we have this check? I think, this should set if current flag is 
different from input flag.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to