ExIceberg.Catalog behaviour (ExIceberg v0.2.0)

This module provides functions to interact with the catalog.

Usage Example

catalog = ExIceberg.Catalog.new("my_catalog", :rest, %{})

{:ok, catalog, _} = ExIceberg.Catalog.create_namespace(catalog, "my_namespace", %{})
{:ok, catalog, _} = ExIceberg.Catalog.list_namespaces(catalog)

As you see in the example above, you need to pass the reasign and pass the catalog to the next function.

Summary

Functions

Creates a new namespace in the catalog.

Drops a namespace from the catalog.

Lists the namespaces in the catalog.

Loads the metadata for a namespace in the catalog.

Checks if a namespace exists in the catalog.

Defines a catalog to be accessed by the client.

Updates the properties of a namespace in the catalog.

Types

@type t() :: %{name: String.t(), type: String.t(), config: struct()}

Callbacks

Link to this callback

create_namespace(t, t, map)

@callback create_namespace(t(), String.t(), map()) ::
  {:ok, t(), map()} | {:error, String.t()}
Link to this callback

drop_namespace(t, t)

@callback drop_namespace(t(), String.t()) :: {:ok, t(), map()} | {:error, String.t()}
Link to this callback

list_namespaces(t)

@callback list_namespaces(t()) :: {:ok, t(), [String.t()]} | {:error, String.t()}
Link to this callback

load_namespace_metadata(t, t)

@callback load_namespace_metadata(t(), String.t()) ::
  {:ok, t(), map()} | {:error, String.t()}
Link to this callback

namespace_exists?(t, t)

@callback namespace_exists?(t(), String.t()) ::
  {:ok, t(), boolean()} | {:error, String.t()}
Link to this callback

update_namespace_properties(t, t, list, map)

@callback update_namespace_properties(t(), String.t(), list(), map()) ::
  {:ok, t(), map()} | {:error, String.t()}

Functions

Link to this function

create_namespace(catalog, namespace, properties)

Creates a new namespace in the catalog.

Examples

iex> ExIceberg.Catalog.create_namespace(catalog, "my_namespace", %{})
{:ok, catalog, %{}}
Link to this function

drop_namespace(catalog, namespace)

Drops a namespace from the catalog.

Examples

iex> ExIceberg.Catalog.drop_namespace(catalog, "my_namespace")
{:ok, catalog, %{}}
Link to this function

list_namespaces(catalog)

Lists the namespaces in the catalog.

Examples

iex> ExIceberg.Catalog.list_namespaces(catalog)
{:ok, catalog, ["namespace1", "namespace2"]}
Link to this function

load_namespace_metadata(catalog, namespace)

Loads the metadata for a namespace in the catalog.

Examples

iex> ExIceberg.Catalog.load_namespace_metadata(catalog, "my_namespace")
{:ok, catalog, %{}}
Link to this function

namespace_exists?(catalog, namespace)

Checks if a namespace exists in the catalog.

Examples

iex> ExIceberg.Catalog.namespace_exists?(catalog, "my_namespace")
{:ok, catalog, true}
Link to this function

new(name, type, config)

Defines a catalog to be accessed by the client.

Examples

iex> ExIceberg.Catalog.new("my_catalog", :rest, %{})
%ExIceberg.Rest.Catalog{name: "my_catalog", config: %{}}

Catalog Types

  • :rest - REST API catalog.

Configuration

The configuration for the catalog is specific to the catalog type.

Link to this function

update_namespace_properties(catalog, namespace, removals, updates)

Updates the properties of a namespace in the catalog.

Examples

iex> ExIceberg.Catalog.update_namespace_properties(catalog, "my_namespace", [], %{})
{:ok, catalog, %{}}