Skip to main content
A 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 as warehouse.department.team.

Class

Creating Namespaces

of()

Creates a namespace from the given levels.
Parameters:
  • levels - The namespace levels
Returns: A new Namespace instance Example:

empty()

Returns an empty namespace.
Returns: An empty namespace instance Example:

Instance Methods

levels()

Returns the array of levels in this namespace.
Returns: Array of namespace levels Example:

level()

Returns the level at the specified position.
Parameters:
  • pos - The position of the level (0-based)
Returns: The level at the specified position Example:

isEmpty()

Checks if this namespace is empty.
Returns: true if the namespace has no levels, false otherwise Example:

length()

Returns the number of levels in this namespace.
Returns: The number of levels Example:

toString()

Returns a string representation of the namespace with levels separated by dots.
Returns: String representation of the namespace Example:

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