jshmchenxi opened a new issue, #13443:
URL: https://github.com/apache/iceberg/issues/13443

   ### Apache Iceberg version
   
   1.8.1
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   When we ran Spark procedure to import partitions from Hive table to Iceberg, 
we got the following error from rest catalog client:
   
   ```
   org.apache.iceberg.exceptions.CommitStateUnknownException: Service failed: 
500: Unhandled SQL exception
   Cannot determine whether the commit was successful or not, the underlying 
data files may or may not be needed. Manual intervention via the Remove Orphan 
Files Action can remove these files when a connection to the Catalog can be 
re-established if the commit was actually unsuccessful.
   Please check to see whether or not your commit was successful before 
retrying this commit. Retrying an already successful operation will result in 
duplicate records or unintentional modifications.
   At this time no files will be deleted including possibly unused manifest 
lists.
        at 
org.apache.iceberg.rest.ErrorHandlers$CommitErrorHandler.accept(ErrorHandlers.java:94)
        at 
org.apache.iceberg.rest.ErrorHandlers$CommitErrorHandler.accept(ErrorHandlers.java:80)
   ```
   
   This was due to some issue from our Iceberg rest catalog service, and the 
log indicates the manifest files will not be deleted.
   
   However, when we checked the Iceberg table, we found it's broken due to 
missing manifest file from filesystem:
   ```
   org.apache.iceberg.exceptions.NotFoundException: Location does not exist: 
s3://bucket/table/metadata/stage-24945-task-2813197-manifest-0742b663-ade6-4d38-9413-6c4d65132a25.avro
   ```
   
   This was because `SparkTableUtil#importSparkPartitions` deletes manifest 
files whenever there is an exception: 
https://github.com/apache/iceberg/blob/apache-iceberg-1.8.1/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java#L827
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [x] I cannot contribute a fix for this bug at this time


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