glue

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: 25 Imported by: 9 modules, 3 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.

Documentation

Index

Constants

View Source
const (

	// property keys
	PropsKeyLocation    = "location"
	PropsKeyDescription = "comment"

	// The ID of the Glue Data Catalog where the tables reside. If none is provided, Glue
	// automatically uses the caller's AWS account ID by default.
	// See: https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-databases.html
	CatalogIDKey = "glue.id"

	// Skip archiving old table versions on commits. Recommended for high-frequency
	// streaming workloads to avoid hitting Glue's archive limits.
	SkipArchive        = "glue.skip-archive"
	SkipArchiveDefault = true

	AccessKeyID     = "glue.access-key-id"
	SecretAccessKey = "glue.secret-access-key"
	SessionToken    = "glue.session-token"
	Region          = "glue.region"
	Endpoint        = "glue.endpoint"
	MaxRetries      = "glue.max-retries"
	RetryMode       = "glue.retry-mode"
)

Variables

This section is empty.

Functions

func DatabaseIdentifier

func DatabaseIdentifier(database string) table.Identifier

DatabaseIdentifier returns a database identifier for a Glue database in the format [database].

func TableIdentifier

func TableIdentifier(database string, tableName string) table.Identifier

TableIdentifier returns a glue table identifier for an Iceberg table in the format [database, table].

Types

type AWSProperties added in v0.8.0

type AWSProperties map[string]string

type Catalog

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

func NewCatalog

func NewCatalog(opts ...Option) (*Catalog, error)

func (*Catalog) CatalogType

func (c *Catalog) CatalogType() catalog.Type

func (*Catalog) CheckNamespaceExists

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

func (*Catalog) CheckTableExists added in v0.3.0

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

CheckTableExists returns if an Iceberg table exists in the Glue catalog.

func (*Catalog) Close added in v0.7.0

func (c *Catalog) Close() error

Close releases the catalog's metrics reporter. The Glue catalog does not own the lifetime of the AWS clients it was configured with, so only the reporter is released. Close is required by catalog.Catalog.

func (*Catalog) CommitTable

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

func (*Catalog) CreateNamespace

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

CreateNamespace creates a new Iceberg namespace in the Glue catalog.

func (*Catalog) CreateTable

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

CreateTable creates a new Iceberg table in the Glue catalog. This function will create the metadata file in S3 using the catalog and table properties, to determine the bucket and key for the metadata location.

func (*Catalog) DropNamespace

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

DropNamespace deletes an Iceberg namespace from the Glue catalog.

func (*Catalog) DropTable

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

DropTable deletes an Iceberg table from the Glue catalog.

func (*Catalog) ListNamespaces

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

ListNamespaces returns a list of Iceberg namespaces from the given Glue catalog.

func (*Catalog) ListTables

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

ListTables returns a list of Iceberg tables in the given Glue database.

The namespace should just contain the Glue database name.

func (*Catalog) LoadNamespaceProperties

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

LoadNamespaceProperties loads the properties of an Iceberg namespace from the Glue catalog.

func (*Catalog) LoadTable

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

LoadTable loads a table from the catalog table details.

The identifier should contain the Glue database name, then Glue table name.

func (*Catalog) Name added in v0.8.0

func (c *Catalog) Name() string

func (*Catalog) PurgeTable added in v0.7.0

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

func (*Catalog) RegisterTable added in v0.3.0

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

RegisterTable registers a new table using existing metadata.

func (*Catalog) RenameTable

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

RenameTable renames an Iceberg table in the Glue catalog.

func (*Catalog) UpdateNamespaceProperties

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

UpdateNamespaceProperties updates the properties of an Iceberg namespace in the Glue catalog. The removals list contains the keys to remove, and the updates map contains the keys and values to update.

type Option

type Option func(*options)

func WithAWSConfig added in v0.8.0

func WithAWSConfig(cfg aws.Config) Option

WithAWSConfig sets the AWS configuration for the catalog.

func WithAWSProperties added in v0.8.0

func WithAWSProperties(props AWSProperties) Option

func WithIORegistry added in v0.8.0

func WithIORegistry(registry *io.Registry) Option

WithIORegistry selects the FileIO factories used by this Glue catalog. A nil registry uses the global default. The registry is shared, not copied, so subsequent Register and Unregister calls affect this catalog.

func WithName added in v0.8.0

func WithName(name string) Option

WithName sets the logical name of this Glue catalog.

Jump to

Keyboard shortcuts

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