Skip to content

Commit 6e78c72

Browse files
Remove the switch statement
1 parent 05dbe0c commit 6e78c72

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,9 @@ protected void initializeCatalog() {
219219
ConnectionType.fromCode(connectionConfigInfoDpo.getConnectionTypeCode());
220220

221221
// Use the unified factory pattern for all external catalog types
222-
String factoryIdentifier;
223-
switch (connectionType) {
224-
case ICEBERG_REST:
225-
case HADOOP:
226-
factoryIdentifier = connectionType.getFactoryIdentifier();
227-
break;
228-
default:
229-
throw new UnsupportedOperationException("Unsupported connection type: " + connectionType);
230-
}
231-
232222
Instance<ExternalCatalogFactory> externalCatalogFactory =
233-
externalCatalogFactories.select(Identifier.Literal.of(factoryIdentifier));
223+
externalCatalogFactories.select(
224+
Identifier.Literal.of(connectionType.getFactoryIdentifier()));
234225
if (!externalCatalogFactory.isUnsatisfied()) {
235226
federatedCatalog =
236227
externalCatalogFactory

0 commit comments

Comments
 (0)