Namespace represents a hierarchical namespace in an Iceberg catalog, similar to a database or schema in traditional database systems.
Overview
Namespaces provide a way to organize tables hierarchically. A namespace can have multiple levels, such aswarehouse.department.team.
Class
Creating Namespaces
of()
Creates a namespace from the given levels.levels- The namespace levels
empty()
Returns an empty namespace.Instance Methods
levels()
Returns the array of levels in this namespace.level()
Returns the level at the specified position.pos- The position of the level (0-based)
isEmpty()
Checks if this namespace is empty.length()
Returns the number of levels in this namespace.toString()
Returns a string representation of the namespace with levels separated by dots.Examples
Creating and Using Namespaces
Iterating Through Namespace Levels
Working with Empty Namespaces
Validation
Namespaces enforce the following constraints:- Cannot be created from a null array
- Individual levels cannot be null
- Levels cannot contain the null-byte character (\u0000)
See Also
- Catalog - Catalog API for namespace and table operations
- TableIdentifier - Table identification with namespaces
- SupportsNamespaces - Catalog extension for namespace operations