poojanilangekar commented on code in PR #2332: URL: https://github.com/apache/polaris/pull/2332#discussion_r2277236823
########## polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java: ########## @@ -77,4 +80,22 @@ public enum ConnectionType { public int getCode() { return this.code; } + + /** + * Get the factory identifier string used for CDI injection of the appropriate + * ExternalCatalogFactory. + * + * @return the factory identifier string + */ + public String getFactoryIdentifier() { + switch (this) { + case ICEBERG_REST: + return ICEBERG_REST_FACTORY_IDENTIFIER; + case HADOOP: + return HADOOP_FACTORY_IDENTIFIER; + default: + throw new UnsupportedOperationException( + "No factory identifier for connection type: " + this); + } + } Review Comment: We can't use the name().toLowerCase() directly because of two reasons: 1. We need the annotations to be constants. (Please see my comment above) 2. We need to explicitly handle the NULL_TYPE/default case. To make things consistent, I've changed the declarations to use lower case. -- 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...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org