glue

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (

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

	// 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

type AwsProperties map[string]string

type Catalog

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

func NewCatalog

func NewCatalog(opts ...Option) *Catalog

NewCatalog creates a new instance of glue.Catalog with the given options.

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) 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) 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

func WithAwsConfig(cfg aws.Config) Option

WithAwsConfig sets the AWS configuration for the catalog.

func WithAwsProperties

func WithAwsProperties(props AwsProperties) Option

Jump to

Keyboard shortcuts

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