okumin commented on code in PR #5895: URL: https://github.com/apache/hive/pull/5895#discussion_r2164391344
########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java: ########## @@ -420,35 +420,30 @@ public List<Void> run(List<Partition> input) throws Exception { req.setCatName(catName); req.setMaxParts((short) -1); parts = handler.get_partitions_req(req).getPartitions(); - Table finalOldt = oldt; + Table table = oldt; int partitionBatchSize = MetastoreConf.getIntVar(handler.getConf(), - MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX); + MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX); Batchable.runBatched(partitionBatchSize, parts, new Batchable<Partition, Void>() { @Override public List<Void> run(List<Partition> input) throws Exception { List<Partition> oldParts = new ArrayList<>(input.size()); List<List<String>> partVals = input.stream().map(Partition::getValues).collect(Collectors.toList()); - // update changed properties (stats) for (Partition part : input) { Partition oldPart = new Partition(part); List<FieldSchema> oldCols = part.getSd().getCols(); part.getSd().setCols(newt.getSd().getCols()); List<ColumnStatistics> colStats = updateOrGetPartitionColumnStats(msdb, catalogName, databaseName, - tableName, part.getValues(), oldCols, finalOldt, part, null, null); + tableName, part.getValues(), oldCols, table, part, null, null); assert (colStats.isEmpty()); if (!cascade) { + // update changed properties (stats) oldPart.setParameters(part.getParameters()); oldParts.add(oldPart); } } Deadline.checkTimeout(); - if (cascade) { - msdb.alterPartitions(catalogName, databaseName, tableName, partVals, input, newt.getWriteId(), - writeIdList); - } else { - msdb.alterPartitions(catalogName, newDbName, newTblName, partVals, oldParts, newt.getWriteId(), - writeIdList); - } Review Comment: Definitely. I will approve the original one had been correct -- 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