Skip to content

Commit 92f9966

Browse files
authored
HIVE-27473: Rewrite MetaStoreClients to be composable (#5771)
1 parent ade51d8 commit 92f9966

File tree

31 files changed

+8921
-7489
lines changed

31 files changed

+8921
-7489
lines changed

hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/HCatClientHMSImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ private void dropPartitionsUsingExpressions(Table table, Map<String, String> par
587587
ExprNodeGenericFuncDesc partitionExpression = new ExpressionBuilder(table, partitionSpec).build();
588588
Pair<Integer, byte[]> serializedPartitionExpression = Pair.of(partitionSpec.size(),
589589
SerializationUtilities.serializeObjectWithTypeInformation(partitionExpression));
590-
hmsClient.dropPartitions(table.getDbName(), table.getTableName(), Arrays.asList(serializedPartitionExpression),
590+
hmsClient.dropPartitions(table.getCatName(), table.getDbName(), table.getTableName(),
591+
Arrays.asList(serializedPartitionExpression),
591592
deleteData && !isExternal(table), // Delete data?
592593
ifExists, // Fail if table doesn't exist?
593594
false); // Need results back?

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.apache.hadoop.fs.Path;
4343
import org.apache.hadoop.hive.common.TableName;
4444
import org.apache.hadoop.hive.metastore.HiveMetaHook;
45-
import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
4645
import org.apache.hadoop.hive.metastore.PartitionDropOptions;
4746
import org.apache.hadoop.hive.metastore.Warehouse;
4847
import org.apache.hadoop.hive.metastore.api.CreateTableRequest;
@@ -53,6 +52,7 @@
5352
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
5453
import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
5554
import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
55+
import org.apache.hadoop.hive.metastore.client.ThriftHiveMetaStoreClient;
5656
import org.apache.hadoop.hive.metastore.partition.spec.PartitionSpecProxy;
5757
import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
5858
import org.apache.hadoop.hive.ql.QueryState;
@@ -1215,7 +1215,7 @@ public void preDropPartitions(org.apache.hadoop.hive.metastore.api.Table hmsTabl
12151215
} catch (IOException e) {
12161216
throw new MetaException(String.format("Error while fetching the partitions due to: %s", e));
12171217
}
1218-
context.putToProperties(HiveMetaStoreClient.SKIP_DROP_PARTITION, "true");
1218+
context.putToProperties(ThriftHiveMetaStoreClient.SKIP_DROP_PARTITION, "true");
12191219
}
12201220

12211221
private static void validatePartitionSpec(SearchArgument sarg, PartitionSpec partitionSpec) {

itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolCatalogOps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ private void withCatalog(String catName, CheckFunc<String> f)
505505
for (String tblName : tblNames) {
506506
client.dropTable(catName, dbName, tblName);
507507
}
508-
client.dropDatabase(catName, dbName);
508+
client.dropDatabase(catName, dbName, true, false, false);
509509
}
510510
client.dropCatalog(catName);
511511
}

ql/src/java/org/apache/hadoop/hive/metastore/SynchronizedMetaStoreClient.java

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)