marton-bod commented on code in PR #3202:
URL: https://github.com/apache/hive/pull/3202#discussion_r848443468


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -460,6 +461,13 @@ public void validateSinkDesc(FileSinkDesc sinkDesc) throws 
SemanticException {
       if (IcebergTableUtil.isBucketed(table)) {
         throw new SemanticException("Cannot perform insert overwrite query on 
bucket partitioned Iceberg table.");
       }
+      if (table.currentSnapshot() != null) {
+        if 
(table.currentSnapshot().allManifests().parallelStream().map(ManifestFile::partitionSpecId)
+            .filter(id -> id < table.spec().specId()).findAny().isPresent()) {
+          throw new SemanticException(
+              "Cannot perform insert overwrite query on Iceberg table where 
partition evolution happened.");

Review Comment:
   Can you please add a note that the table must be rewritten according to the 
last spec in order to be able to start using IOW again? IOW can be an unsafe 
operation when there are different data files written out according to 
different partition specs



-- 
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]

Reply via email to