diff --git a/partiql-spi/src/main/java/org/partiql/spi/catalog/PartiQLSystemCatalog.java b/partiql-spi/src/main/java/org/partiql/spi/catalog/PartiQLSystemCatalog.java index 87cc927de5..e674cf5ff8 100644 --- a/partiql-spi/src/main/java/org/partiql/spi/catalog/PartiQLSystemCatalog.java +++ b/partiql-spi/src/main/java/org/partiql/spi/catalog/PartiQLSystemCatalog.java @@ -10,7 +10,7 @@ /** *

- * This implements the PartiQL System Catalog. + * This package-private class implements the PartiQL System Catalog. *

*

* It provides the implementation for the PartiQL System Catalog, which is a built-in catalog @@ -20,24 +20,18 @@ */ final class PartiQLSystemCatalog implements Catalog { - /** - * TODO - */ @NotNull - private final String name; + private static final String NAME = "$system"; /** - * Creates a new PartiQL System Catalog with the given name. - * @param name the name of the PartiQL System Catalog + * This is a package-private singleton. */ - PartiQLSystemCatalog(@NotNull String name) { - this.name = name; - } + static PartiQLSystemCatalog INSTANCE = new PartiQLSystemCatalog(); @NotNull @Override public String getName() { - return this.name; + return NAME; } @Nullable diff --git a/partiql-spi/src/main/kotlin/org/partiql/spi/catalog/Session.kt b/partiql-spi/src/main/kotlin/org/partiql/spi/catalog/Session.kt index 50e539f2f0..47cb0c5148 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/spi/catalog/Session.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/spi/catalog/Session.kt @@ -62,7 +62,7 @@ public interface Session { private var identity: String = "unknown" private var catalog: String? = null - private var systemCatalog: Catalog = PartiQLSystemCatalog("\$system") + private var systemCatalog: Catalog = PartiQLSystemCatalog.INSTANCE private var catalogs: Catalogs.Builder = Catalogs.builder() private var namespace: Namespace = Namespace.empty() private var properties: MutableMap = mutableMapOf()