dengzhhu653 commented on code in PR #4684: URL: https://github.com/apache/hive/pull/4684#discussion_r1336619281
########## ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/alter/AlterTableAlterPartitionOperation.java: ########## @@ -92,22 +91,23 @@ private void checkPartitionValues(Table tbl, int colIndex) throws HiveException Converter converter = ObjectInspectorConverters.getConverter( PrimitiveObjectInspectorFactory.javaStringObjectInspector, outputOI); - Set<Partition> partitions = context.getDb().getAllPartitionsOf(tbl); - for (Partition part : partitions) { - if (part.getName().equals(context.getConf().getVar(HiveConf.ConfVars.DEFAULTPARTITIONNAME))) { - continue; - } - + List<String> partNames = context.getDb().getPartitionNames(tbl.getDbName(), Review Comment: The `Hive` class(context.getDb()) doesn't provide direct access to `listParititonNamesRequest` or `listPartitionNames(catname...)`, the `listParititonNames` in Hive will catch `NoSuchObjectException` and return an empty list in case no partition exists, so I prefer Hive#listPartitionNames here. By default, all listPartitions APIs would not ignore the default partition, except when provide a valid filter. -- 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