You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by tm...@apache.org on 2019/08/27 22:26:25 UTC

[impala] 01/04: IMPALA-8896: fix alterPartitionsWithTransaction() that emitted too many alter tables.

This is an automated email from the ASF dual-hosted git repository.

tmarshall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit db007486a3d11ca935c3a6722f9ae388fb097853
Author: Zoltan Borok-Nagy <bo...@cloudera.com>
AuthorDate: Tue Aug 27 12:05:21 2019 +0200

    IMPALA-8896: fix alterPartitionsWithTransaction() that emitted too many alter tables.
    
    Moved 'alter_partitions()' RPC outside of the for-loop
    in alterPartitionsWithTransaction(). Having it inside the for-loop made
    many unnecessary RPC calls towards HMS.
    
    Change-Id: I47d9d732caf3093206efb1f283fec2eee3347671
    Reviewed-on: http://gerrit.cloudera.org:8080/14148
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 .../java/org/apache/impala/compat/MetastoreShim.java              | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fe/src/compat-hive-3/java/org/apache/impala/compat/MetastoreShim.java b/fe/src/compat-hive-3/java/org/apache/impala/compat/MetastoreShim.java
index e96e7b3..d5a3da6 100644
--- a/fe/src/compat-hive-3/java/org/apache/impala/compat/MetastoreShim.java
+++ b/fe/src/compat-hive-3/java/org/apache/impala/compat/MetastoreShim.java
@@ -237,11 +237,11 @@ public class MetastoreShim {
       ) throws InvalidOperationException, MetaException, TException {
     for (Partition part : partitions) {
       part.setWriteId(tblTxn.writeId);
-      // Correct validWriteIdList is needed
-      // to commit the alter partitions operation in hms side.
-      client.alter_partitions(dbName, tblName, partitions, null,
-           tblTxn.validWriteIds, tblTxn.writeId);
     }
+    // Correct validWriteIdList is needed
+    // to commit the alter partitions operation in hms side.
+    client.alter_partitions(dbName, tblName, partitions, null,
+        tblTxn.validWriteIds, tblTxn.writeId);
   }
 
   /**