DanielZhu58 commented on code in PR #5578:
URL: https://github.com/apache/hive/pull/5578#discussion_r1917827679
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -10420,6 +10522,100 @@ public boolean deleteTableColumnStatistics(String
catName, String dbName, String
return ret;
}
+ @Override
+ public boolean deleteTableMultiColumnStatistics(String catName, String
dbName, String tableName,
+ List<String> colNames, String
engine)
+ throws NoSuchObjectException, MetaException, InvalidObjectException,
InvalidInputException {
+ boolean ret = false;
+ Query query = null;
+ dbName = org.apache.commons.lang3.StringUtils.defaultString(dbName,
+ Warehouse.DEFAULT_DATABASE_NAME);
+ if (tableName == null) {
+ throw new InvalidInputException("Table name is null.");
+ }
+ try {
+ openTransaction();
+ MTable mTable = getMTable(catName, dbName, tableName);
+ MTableColumnStatistics mStatsObj;
+ List<MTableColumnStatistics> mStatsObjColl;
+ if (mTable == null) {
+ throw new NoSuchObjectException("Table " +
+ TableName.getQualified(catName, dbName, tableName)
+ + " for which stats deletion is requested doesn't exist");
+ }
+ // Note: this does not verify ACID state; called internally when
removing cols/etc.
+ // Also called via an unused metastore API that checks for ACID
tables.
+ query = pm.newQuery(MTableColumnStatistics.class);
+ String filter;
+ String parameters;
+ if (colNames != null) {
+ filter = "table.tableName == t1 && table.database.name == t2 &&
table.database.catalogName == t3 && t4.contains(colName)" + (engine != null ? "
&& engine == t5" : "");
+ parameters = "java.lang.String t1, java.lang.String t2,
java.lang.String t3, java.util.Collection t4" + (engine != null ? ",
java.lang.String t5" : "");
+ } else {
+ filter = "table.tableName == t1 && table.database.name == t2 &&
table.database.catalogName == t3" + (engine != null ? " && engine == t4" : "");
+ parameters = "java.lang.String t1, java.lang.String t2,
java.lang.String t3" + (engine != null ? ", java.lang.String t4" : "");
+ }
+
+ query.setFilter(filter);
+ query.declareParameters(parameters);
+ if (colNames != null) {
+ query.setUnique(true);
Review Comment:
Acknowledged.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]