You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "pudidic (via GitHub)" <gi...@apache.org> on 2023/02/01 01:19:02 UTC

[GitHub] [hive] pudidic commented on a diff in pull request #3995: HIVE-26960: Fix optimized bootstrap when primary is modified only by …

pudidic commented on code in PR #3995:
URL: https://github.com/apache/hive/pull/3995#discussion_r1092651154


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWork.java:
##########
@@ -159,20 +159,25 @@ public ReplLoadWork(HiveConf hiveConf, String dumpDirectory,
        * for the same.
        */
       Path incBootstrapDir = new Path(dumpDirectory, ReplUtils.INC_BOOTSTRAP_ROOT_DIR_NAME);
-      if (fs.exists(incBootstrapDir)) {
-        if (isSecondFailover) {
-          String[] bootstrappedTables = getBootstrapTableList(new Path(dumpDirectory).getParent(), hiveConf);
-          LOG.info("Optimised bootstrap load for database {} with initial bootstrapped table list as {}",
-              dbNameToLoadIn, tablesToBootstrap);
-          // Get list of tables bootstrapped.
+      if (isSecondFailover) {
+        String[] bootstrappedTables = getBootstrapTableList(new Path(dumpDirectory).getParent(), hiveConf);
+        LOG.info("Optimised bootstrap load for database {} with initial bootstrapped table list as {}",
+                dbNameToLoadIn, tablesToBootstrap);
+        // Get list of tables bootstrapped.
+        if (fs.exists(incBootstrapDir)) {
           Path tableMetaPath = new Path(incBootstrapDir, EximUtil.METADATA_PATH_NAME + "/" + sourceDbName);
           tablesToBootstrap =
-              Stream.of(fs.listStatus(tableMetaPath)).map(st -> st.getPath().getName()).collect(Collectors.toList());
-          List<String> tableList = Arrays.asList(bootstrappedTables);
-          tablesToDrop = ListUtils.subtract(tableList, tablesToBootstrap);
-          LOG.info("Optimised bootstrap for database {} with drop table list as {} and bootstrap table list as {}",
-              dbNameToLoadIn, tablesToDrop, tablesToBootstrap);
+                  Stream.of(fs.listStatus(tableMetaPath)).map(st -> st.getPath().getName()).collect(Collectors.toList());
+        }
+        else {
+          tablesToBootstrap = Collections.emptyList();

Review Comment:
   Elegant code without for loop, nulls. :)



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

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