deniskuzZ commented on code in PR #5223: URL: https://github.com/apache/hive/pull/5223#discussion_r2264903509
########## standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/ThriftHiveMetaStoreClient.java: ########## @@ -1588,34 +1588,18 @@ public boolean dropPartition(String catName, String db_name, String tbl_name, } @Override - public List<Partition> dropPartitions(String catName, String dbName, String tblName, - List<Pair<Integer, byte[]>> partExprs, PartitionDropOptions options, EnvironmentContext context) + public List<Partition> dropPartitions(TableName tableName, + RequestPartsSpec partsSpec, PartitionDropOptions options, EnvironmentContext context) throws NoSuchObjectException, MetaException, TException { - if (context == null) { - context = new EnvironmentContext(); - } - - if (context.getProperties() != null && - Boolean.parseBoolean(context.getProperties().get(SKIP_DROP_PARTITION))) { - return Lists.newArrayList(); - } - - RequestPartsSpec rps = new RequestPartsSpec(); - List<DropPartitionsExpr> exprs = new ArrayList<>(partExprs.size()); - - for (Pair<Integer, byte[]> partExpr : partExprs) { - DropPartitionsExpr dpe = new DropPartitionsExpr(); - dpe.setExpr(partExpr.getRight()); - dpe.setPartArchiveLevel(partExpr.getLeft()); - exprs.add(dpe); - } - rps.setExprs(exprs); - DropPartitionsRequest req = new DropPartitionsRequest(dbName, tblName, rps); - req.setCatName(catName); + DropPartitionsRequest req = new DropPartitionsRequest(tableName.getDb(), tableName.getTable(), partsSpec); + req.setCatName(tableName.getCat()); req.setDeleteData(options.deleteData); req.setNeedResult(options.returnResults); req.setIfExists(options.ifExists); + if (context == null) { + context = new EnvironmentContext(); + } Review Comment: drop the redundant `context = Optional.ofNullable(context).orElse(new EnvironmentContext());` below -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org