eric-maynard commented on code in PR #243:
URL: https://github.com/apache/polaris/pull/243#discussion_r1773683079


##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java:
##########
@@ -257,6 +260,12 @@ public <T> T runInTransaction(
       } finally {
         localSession.remove();
       }
+    } catch (PersistenceException e) {
+      if (e.toString().toLowerCase(Locale.ROOT).contains("duplicate key")) {
+        throw new AlreadyExistsException(e, "Duplicate key error when 
persisting entity");

Review Comment:
   The practical reason we use an Iceberg exception is because we already have 
exception mapping via `IcebergExceptionMapper` for this exception. This 
exception is currently used throughout Polaris 
([e.g.](https://github.com/apache/polaris/blob/81ec424de5bf4e466660b15dca1778026be07e9e/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java#L1542))
 and so I think it's good to be consistent with that.



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

Reply via email to