glue

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

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

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)

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, props iceberg.Properties) (*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) 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