Hi Alex, Thanks for reviving this issue's discussion.
Polaris is a catalog of diverse entities. From the user's perspective, I think the entity name (in a namespace) is the natural and primary identifier of an entity. Therefore, I believe Polaris should enforce name uniqueness without taking entity type into account. This way, given a name, the user / client can unambiguously resolve it to one specific entity. Re: upgrades, it is indeed a concern for old catalogs. However, since renames are supported, users should be able to disambiguate overlapping names before upgrading. Re: enforcement, now that we started the "catalog abstraction" discussion [1], I think it would be natural to defer enforcement to the new SPI that will result from that proposal. If we want to proactively begin enforcing name uniqueness before the new SPI is defined, I guess we could do so at entity resolution time. This approach may lack strict atomicity, but it will set proper user expectations. A solid atomic enforcement approach will come later. Cheers, Dmitri. [1] https://lists.apache.org/thread/01tonkljgt5npybtk71q2j425182pxq0 On Fri, Dec 4, 2026 at 11:49 AM Alex Dutra via dev <[email protected]> wrote: > Hi all, > > Issue [4168] asks for tests checking that a name within a namespace > maps to at most one entity (table, view, generic table or nested > namespace). > > Writing them showed that this only holds partly today, and the fix in > [4190] changes behavior, so I'd like to agree on the approach here > first. > > Today, table vs. view and table vs. generic table collisions are > rejected with 409. But namespace vs. any table-like entity collisions > are not checked at all, because the metastore uniqueness key includes > the entity type. Such collisions are only blocked by accident, by the > location-overlap check. > > [4190] rejects creating, registering or renaming to a name already > used by a different kind of entity under the same parent, with 409 > AlreadyExistsException. Existing collisions are left untouched on > upgrade. The check is a read-before-write in the catalog layer, so > concurrent creates can still race. > > Questions for the community: > > 1. Is strict sibling-name uniqueness the behavior we want? It is a > behavior change, and some existing tests currently assume tables and > namespaces may share a name. Does anyone see an upgrade concern? > > 2. Should this be enforced atomically by the metastore, as Robert > suggested, or resolved up front through the PolarisResolutionManifest, > as Dmitri suggested? Or can we merge the preflight approach first and > track atomic enforcement as a follow-up? > > Thanks, > Alex > > [4168]: https://github.com/apache/polaris/issues/4168 > [4190]: https://github.com/apache/polaris/pull/4190 >
