difin commented on code in PR #5248: URL: https://github.com/apache/hive/pull/5248#discussion_r1650226143
########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java: ########## @@ -1811,16 +1808,27 @@ private List<String> getPartitions(DDLOperationContext context, Configuration jo String[] row = fetcher.convert(currSerDe.deserialize(value), currSerDe.getObjectInspector()) .toString().split("\t"); - parts.add(HiveTableUtil.getParseData(row[PART_IDX], row[SPEC_IDX], mapper, tbl.spec().specId())); + parts.add(HiveTableUtil.getParseData(row[IcebergTableUtil.PART_IDX], row[IcebergTableUtil.SPEC_IDX], + mapper, tbl.spec().specId())); } } Collections.sort(parts); return parts; } @Override - public void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table hmsTable, Map<String, String> partitionSpec) - throws SemanticException { + public void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table hmsTable, Map<String, String> partitionSpec, + Context.RewritePolicy policy) throws SemanticException { + Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable()); + if (policy == Context.RewritePolicy.PARTITION) { + validatePartSpecImpl(hmsTable, partitionSpec, IcebergTableUtil.getPartitionFields(table)); + } else { + validatePartSpecImpl(hmsTable, partitionSpec, table.spec().fields()); + } + } + + private void validatePartSpecImpl(org.apache.hadoop.hive.ql.metadata.Table hmsTable, + Map<String, String> partitionSpec, List<PartitionField> allPartFields) throws SemanticException { Review Comment: Done -- 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