ayushtkn commented on code in PR #5173:
URL: https://github.com/apache/hive/pull/5173#discussion_r1546891125
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1817,6 +1821,8 @@ public boolean
canUseTruncate(org.apache.hadoop.hive.ql.metadata.Table hmsTable,
Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
if (MapUtils.isEmpty(partitionSpec) ||
!hasUndergonePartitionEvolution(table)) {
return true;
+ } else if (hmsTable.getSnapshotRef() != null) {
Review Comment:
below there is some more optimisation for normal table, I don't catch it
well but it is checking if the table has undergone partition evolution, but
there is no datafile outside the new partition or so, so in that case even in
case of partition evolution you can go with truncate but that would throw you
an NPE, in case of branches if the partition column is removed in the current
table spec.
--
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]