cccs-br commented on PR #7561: URL: https://github.com/apache/iceberg/pull/7561#issuecomment-1927761923
Since the JdbcCatalog provides the means to specify your own JdbcClientPool by providing a [client pool builder](https://github.com/apache/iceberg/blob/c4cb0fb9993d6743d81a232def6801ea7dbbe176/core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java#L91), one could achieve the desired behavior by extending the JdbcCatalog and overriding the constructor. For example, something along those line: ```java package org.abc.catalogs; import java.sql.SQLException; import java.util.List; import java.util.Map; import org.apache.iceberg.jdbc.JdbcCatalog; import org.apache.iceberg.jdbc.JdbcClientPool; public class CustomJdbcCatalog extends JdbcCatalog { private static final List<String> RETRY_EXCEPTION_STATE = List.of("08006", "57000"); public CustomJdbcCatalog() { super(null, (Map<String, String> props) -> { String uri = props.get("uri"); return new JdbcClientPool(uri, props) { @Override protected boolean isConnectionException(Exception exc) { boolean isRetry = super.isConnectionException(exc); if (exc instanceof SQLException sqle) { isRetry = RETRY_EXCEPTION_STATE.contains(sqle.getSQLState()); } return isRetry; } }; }, false); } } ``` This gives you full control over the logic of the retry. If in the context of spark, you could simply specify `org.abc.catalogs.CustomJdbcCatalog` for the `spark.sql.catalog.<catalog_name>.catalog-impl` parameter. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org