dynamodb

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

DynamoDB catalog

Import github.com/apache/iceberg-go/catalog/dynamodb to register the catalog. The AWS SDK default credential chain is used by catalog.Load. NewCatalog accepts an aws.Config for custom credentials, transports, and retry settings.

Property Meaning
type dynamodb
warehouse Required default table storage location
dynamodb.table-name Backing DynamoDB table, default iceberg
dynamodb.endpoint Optional service endpoint, including DynamoDB Local
client.region AWS region override when using the registry

The catalog creates the backing table when it is absent. It uses Java's identifier/namespace keys, the namespace-identifier index, p. property columns, UUID versions, and millisecond timestamps. Separate logical catalogs must use separate backing tables to keep their contents separate.

Namespace default_location controls the default location for its tables. Namespace components and table names cannot contain dots. Go namespace creation requires its immediate parent to exist. Lists return direct children.

Metadata commits use conditional transactions and idempotency tokens. Rename atomically moves the catalog entry and keeps the metadata location. Go writers also update namespace versions when creating tables or child namespaces, or registering and renaming tables. This protects namespace deletion against concurrent Go creation. Java writers do not update these namespace versions; namespace lifecycle changes shared with Java need external coordination. These version updates can conflict when many tables or child namespaces are created in the same namespace, or when its properties are updated concurrently. Creation retries a limited number of times and can return ErrCommitFailed.

Dropping a namespace checks the index first, then scans the backing table with consistent reads to confirm that it is empty. A successful drop therefore uses read capacity proportional to the size of the whole catalog table.

Run the local integration suite with:

docker run --rm -p 8000:8000 amazon/dynamodb-local:latest -jar DynamoDBLocal.jar -inMemory -sharedDb
make integration-dynamodb

The shared integration recipe starts DynamoDB Local and runs this suite in CI.

Documentation

Overview

Package dynamodb implements the Java-compatible AWS DynamoDB catalog. Import it to register the "dynamodb" catalog type.

Index

Constants

View Source
const (
	TableNameKey       = "dynamodb.table-name"
	EndpointKey        = "dynamodb.endpoint"
	DefaultLocationKey = "default_location"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog stores metadata pointers and namespaces in one DynamoDB table. The backing table layout is shared with Java's DynamoDbCatalog. Namespace emptiness checks use consistent reads; concurrent namespace deletion is coordinated with Go writers, while Java writers retain Java's weaker behavior.

func NewCatalog

func NewCatalog(ctx context.Context, name string, cfg aws.Config, props iceberg.Properties, options ...func(*dynamodb.Options)) (*Catalog, error)

NewCatalog opens a catalog and creates its backing DynamoDB table if absent. cfg supplies AWS credentials, region, and transport. The warehouse property is required; dynamodb.table-name defaults to "iceberg". Options configure the SDK service client, for example an endpoint for DynamoDB Local.

func (*Catalog) CatalogType

func (*Catalog) CatalogType() catalog.Type

func (*Catalog) CheckNamespaceExists

func (c *Catalog) CheckNamespaceExists(ctx context.Context, ns table.Identifier) (bool, error)

func (*Catalog) CheckTableExists

func (c *Catalog) CheckTableExists(ctx context.Context, ident table.Identifier) (bool, error)

func (*Catalog) Close

func (c *Catalog) Close() error

func (*Catalog) CommitTable

func (c *Catalog) CommitTable(ctx context.Context, ident table.Identifier, requirements []table.Requirement, updates []table.Update) (table.Metadata, string, error)

func (*Catalog) CreateNamespace

func (c *Catalog) CreateNamespace(ctx context.Context, ns table.Identifier, props iceberg.Properties) error

func (*Catalog) CreateTable

func (c *Catalog) CreateTable(ctx context.Context, ident table.Identifier, schema *iceberg.Schema, opts ...catalog.CreateTableOpt) (*table.Table, error)

func (*Catalog) DropNamespace

func (c *Catalog) DropNamespace(ctx context.Context, ns table.Identifier) error

func (*Catalog) DropTable

func (c *Catalog) DropTable(ctx context.Context, ident table.Identifier) error

func (*Catalog) ListNamespaces

func (c *Catalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)

func (*Catalog) ListTables

func (c *Catalog) ListTables(ctx context.Context, ns table.Identifier) iter.Seq2[table.Identifier, error]

func (*Catalog) LoadNamespaceProperties

func (c *Catalog) LoadNamespaceProperties(ctx context.Context, ns table.Identifier) (iceberg.Properties, error)

func (*Catalog) LoadTable

func (c *Catalog) LoadTable(ctx context.Context, ident table.Identifier) (*table.Table, error)

func (*Catalog) Name

func (c *Catalog) Name() string

func (*Catalog) PurgeTable

func (c *Catalog) PurgeTable(ctx context.Context, ident table.Identifier) error

func (*Catalog) RegisterTable

func (c *Catalog) RegisterTable(ctx context.Context, ident table.Identifier, location string) (*table.Table, error)

func (*Catalog) RenameTable

func (c *Catalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)

func (*Catalog) UpdateNamespaceProperties

func (c *Catalog) UpdateNamespaceProperties(ctx context.Context, ns table.Identifier, removals []string, updates iceberg.Properties) (catalog.PropertiesUpdateSummary, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL