pvary commented on a change in pull request #1217:
URL: https://github.com/apache/hive/pull/1217#discussion_r450754893
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -3580,7 +3592,19 @@ public boolean dropPartition(String dbName, String
tableName, List<String> parti
List<String> pvals = MetaStoreUtils.getPvals(t.getPartCols(), partSpec);
try {
- names = getMSC().listPartitionNames(dbName, tblName, pvals, max);
+ if (AcidUtils.isTransactionalTable(t)) {
+ GetPartitionNamesPsRequest req = new GetPartitionNamesPsRequest();
+ req.setTblName(tblName);
+ req.setDbName(dbName);
+ req.setPartValues(pvals);
+ req.setMaxParts(max);
+ ValidWriteIdList validWriteIdList = getValidWriteIdList(dbName,
tblName);
+ req.setValidWriteIdList(validWriteIdList != null ?
validWriteIdList.toString() : null);
+ GetPartitionNamesPsResponse res =
getMSC().listPartitionNamesRequest(req);
+ names = res.getNames();
+ } else {
+ names = getMSC().listPartitionNames(dbName, tblName, pvals, max);
Review comment:
Maybe use the same listPartitionNamesReques for acid and non-acid tables
as well?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -3602,9 +3626,27 @@ public boolean dropPartition(String dbName, String
tableName, List<String> parti
exprBytes = SerializationUtilities.serializeExpressionToKryo(expr);
}
try {
+
String defaultPartitionName = HiveConf.getVar(conf,
ConfVars.DEFAULTPARTITIONNAME);
- names = getMSC().listPartitionNames(tbl.getCatalogName(),
tbl.getDbName(),
- tbl.getTableName(), defaultPartitionName, exprBytes, order,
maxParts);
+
+ if (AcidUtils.isTransactionalTable(tbl)) {
+ PartitionsByExprRequest req =
+ new PartitionsByExprRequest(tbl.getDbName(), tbl.getTableName(),
ByteBuffer.wrap(exprBytes));
+ req.setDefaultPartitionName(defaultPartitionName);
+ if (maxParts >= 0) {
+ req.setMaxParts(maxParts);
+ }
+ req.setOrder(order);
+ req.setCatName(tbl.getCatalogName());
+ ValidWriteIdList validWriteIdList =
getValidWriteIdList(tbl.getDbName(), tbl.getTableName());
+ req.setValidWriteIdList(validWriteIdList != null ?
validWriteIdList.toString() : null);
+ names = getMSC().listPartitionNames(req);
+
+ } else {
+ names = getMSC()
+ .listPartitionNames(tbl.getCatalogName(), tbl.getDbName(),
tbl.getTableName(), defaultPartitionName,
Review comment:
Maybe use the same listPartitionNamesReques for acid and non-acid tables
as well?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]