deniskuzZ commented on code in PR #5123:
URL: https://github.com/apache/hive/pull/5123#discussion_r1573884289
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1915,6 +1915,28 @@ private boolean hasUndergonePartitionEvolution(Table
table) {
.anyMatch(id -> id < table.spec().specId());
}
+ private boolean
isIdentityPartitionTable(org.apache.hadoop.hive.ql.metadata.Table table) {
+ return
getPartitionTransformSpec(table).stream().map(TransformSpec::getTransformType)
+ .allMatch(type -> type == TransformSpec.TransformType.IDENTITY);
+ }
+
+ @Override
+ public boolean
isEligibilityForCompaction(org.apache.hadoop.hive.ql.metadata.Table table,
+ Map<String, String> partitionSpec) throws HiveException {
+ if (partitionSpec != null) {
+ Table icebergTable = IcebergTableUtil.getTable(conf, table.getTTable());
+ if (hasUndergonePartitionEvolution(icebergTable)) {
+ throw new HiveException("Compaction on partition level is not
supported on the table " +
+ table.getDbName() + "." + table.getTableName() + " which has
undergone partition evolution");
+ }
+ if (!isIdentityPartitionTable(table)) {
Review Comment:
only primitiveTypes: `partitionData.getType(i).isPrimitiveType()`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]