This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-2.3 by this push:
new efd5212 HIVE-25500: Switch back to alter_partition(s) in HMS client
for Hive 2.3.x (#2618)
efd5212 is described below
commit efd5212fd6273c6aa5e97b4dbe5183e43e1a9675
Author: cxzl25 <[email protected]>
AuthorDate: Thu Sep 9 01:09:00 2021 +0800
HIVE-25500: Switch back to alter_partition(s) in HMS client for Hive 2.3.x
(#2618)
---
.../hadoop/hive/metastore/HiveMetaStoreClient.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git
a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 53d97ff..3b774a0 100644
---
a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++
b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -1503,25 +1503,33 @@ public class HiveMetaStoreClient implements
IMetaStoreClient {
@Override
public void alter_partition(String dbName, String tblName, Partition newPart)
throws InvalidOperationException, MetaException, TException {
- client.alter_partition_with_environment_context(dbName, tblName, newPart,
null);
+ client.alter_partition(dbName, tblName, newPart);
}
@Override
public void alter_partition(String dbName, String tblName, Partition
newPart, EnvironmentContext environmentContext)
throws InvalidOperationException, MetaException, TException {
- client.alter_partition_with_environment_context(dbName, tblName, newPart,
environmentContext);
+ if (environmentContext == null) {
+ client.alter_partition(dbName, tblName, newPart);
+ } else {
+ client.alter_partition_with_environment_context(dbName, tblName,
newPart, environmentContext);
+ }
}
@Override
public void alter_partitions(String dbName, String tblName, List<Partition>
newParts)
throws InvalidOperationException, MetaException, TException {
- client.alter_partitions_with_environment_context(dbName, tblName,
newParts, null);
+ client.alter_partitions(dbName, tblName, newParts);
}
@Override
public void alter_partitions(String dbName, String tblName, List<Partition>
newParts, EnvironmentContext environmentContext)
throws InvalidOperationException, MetaException, TException {
- client.alter_partitions_with_environment_context(dbName, tblName,
newParts, environmentContext);
+ if (environmentContext == null) {
+ client.alter_partitions(dbName, tblName, newParts);
+ } else {
+ client.alter_partitions_with_environment_context(dbName, tblName,
newParts, environmentContext);
+ }
}
@Override