You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/01/11 03:27:55 UTC

[GitHub] [hive] pkumarsinha commented on a change in pull request #1804: HIVE-24558 : Handle update in table level regular expression

pkumarsinha commented on a change in pull request #1804:
URL: https://github.com/apache/hive/pull/1804#discussion_r554672844



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -410,12 +413,16 @@ private boolean shouldDump(Path previousDumpPath) throws IOException {
    * @return true if need to examine tables for dump and false if not.
    */
   private boolean shouldExamineTablesToDump() {
-    return (work.oldReplScope != null)
+    return (previousReplScopeModified())
             || !tablesForBootstrap.isEmpty()
             || conf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES)
             || conf.getBoolVar(HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES);
   }
 
+  private boolean previousReplScopeModified() {

Review comment:
       dmd.setDump(DumpType.BOOTSTRAP, bootDumpBeginReplId, bootDumpEndReplId, cmRoot, executorId,
           work.oldReplScope != null);
   Shouldn't this line also also previousReplScopeModified() otherwise load will always assume that there is change in expession.

##########
File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/repl/ReplScope.java
##########
@@ -116,4 +117,27 @@ private boolean inTableExcludedList(final String tableName) {
     }
     return excludedTableNamePattern.matcher(tableName).matches();
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (! (o instanceof ReplScope)) {
+      return false;
+    }
+
+    ReplScope replScope = (ReplScope)o;
+    return ((replScope.getExcludedTableNames() == null ?  (this.excludedTableNames == null) :
+      replScope.getExcludedTableNames().equals(this.excludedTableNames))

Review comment:
       nit: getExcludedTableNames() /getIncludedTableNames() methods can be replaced by replScope.excludedTableNamePattern and replScope.includedTableNamePattern respectively.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org