Documentation ¶
Index ¶
- Variables
- func GlueDatabaseIdentifier(database string) table.Identifier
- func GlueTableIdentifier(database string, tableName string) table.Identifier
- func NamespaceFromIdent(ident table.Identifier) table.Identifier
- func TableNameFromIdent(ident table.Identifier) string
- func ToRestIdentifier(ident ...string) table.Identifier
- type Catalog
- type CatalogType
- type GlueCatalog
- func (c *GlueCatalog) CatalogType() CatalogType
- func (c *GlueCatalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
- func (c *GlueCatalog) DropNamespace(ctx context.Context, namespace table.Identifier) error
- func (c *GlueCatalog) DropTable(ctx context.Context, identifier table.Identifier) error
- func (c *GlueCatalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
- func (c *GlueCatalog) ListTables(ctx context.Context, namespace table.Identifier) ([]table.Identifier, error)
- func (c *GlueCatalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
- func (c *GlueCatalog) LoadTable(ctx context.Context, identifier table.Identifier, props iceberg.Properties) (*table.Table, error)
- func (c *GlueCatalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)
- func (c *GlueCatalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, ...) (PropertiesUpdateSummary, error)
- type Option
- func WithAuthURI(uri *url.URL) Option[RestCatalog]
- func WithAwsConfig(cfg aws.Config) Option[GlueCatalog]
- func WithCredential(cred string) Option[RestCatalog]
- func WithMetadataLocation(loc string) Option[RestCatalog]
- func WithOAuthToken(token string) Option[RestCatalog]
- func WithPrefix(prefix string) Option[RestCatalog]
- func WithSigV4() Option[RestCatalog]
- func WithSigV4RegionSvc(region, service string) Option[RestCatalog]
- func WithTLSConfig(config *tls.Config) Option[RestCatalog]
- func WithWarehouseLocation(loc string) Option[RestCatalog]
- type PropertiesUpdateSummary
- type RestCatalog
- func (r *RestCatalog) CatalogType() CatalogType
- func (r *RestCatalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
- func (r *RestCatalog) DropNamespace(ctx context.Context, namespace table.Identifier) error
- func (r *RestCatalog) DropTable(ctx context.Context, identifier table.Identifier) error
- func (r *RestCatalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
- func (r *RestCatalog) ListTables(ctx context.Context, namespace table.Identifier) ([]table.Identifier, error)
- func (r *RestCatalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
- func (r *RestCatalog) LoadTable(ctx context.Context, identifier table.Identifier, props iceberg.Properties) (*table.Table, error)
- func (r *RestCatalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)
- func (r *RestCatalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, ...) (PropertiesUpdateSummary, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoSuchTable is returned when a table does not exist in the catalog. ErrNoSuchTable = errors.New("table does not exist") ErrNoSuchNamespace = errors.New("namespace does not exist") ErrNamespaceAlreadyExists = errors.New("namespace already exists") )
View Source
var ( ErrRESTError = errors.New("REST error") ErrBadRequest = fmt.Errorf("%w: bad request", ErrRESTError) ErrForbidden = fmt.Errorf("%w: forbidden", ErrRESTError) ErrAuthorizationExpired = fmt.Errorf("%w: authorization expired", ErrRESTError) ErrServerError = fmt.Errorf("%w: server error", ErrRESTError) ErrCommitFailed = fmt.Errorf("%w: commit failed, refresh and try again", ErrRESTError) ErrCommitStateUnknown = fmt.Errorf("%w: commit failed due to unknown reason", ErrRESTError) ErrOAuthError = fmt.Errorf("%w: oauth error", ErrRESTError) )
Functions ¶
func GlueDatabaseIdentifier ¶
func GlueDatabaseIdentifier(database string) table.Identifier
GlueDatabaseIdentifier returns a database identifier for a Glue database in the format [database].
func GlueTableIdentifier ¶
func GlueTableIdentifier(database string, tableName string) table.Identifier
GlueTableIdentifier returns a glue table identifier for an iceberg table in the format [database, table].
func NamespaceFromIdent ¶
func NamespaceFromIdent(ident table.Identifier) table.Identifier
func TableNameFromIdent ¶
func TableNameFromIdent(ident table.Identifier) string
func ToRestIdentifier ¶
func ToRestIdentifier(ident ...string) table.Identifier
Types ¶
type Catalog ¶
type Catalog interface { // CatalogType returns the type of the catalog. CatalogType() CatalogType // ListTables returns a list of table identifiers in the catalog, with the returned // identifiers containing the information required to load the table via that catalog. ListTables(ctx context.Context, namespace table.Identifier) ([]table.Identifier, error) // LoadTable loads a table from the catalog and returns a Table with the metadata. LoadTable(ctx context.Context, identifier table.Identifier, props iceberg.Properties) (*table.Table, error) // DropTable tells the catalog to drop the table entirely DropTable(ctx context.Context, identifier table.Identifier) error // RenameTable tells the catalog to rename a given table by the identifiers // provided, and then loads and returns the destination table RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error) // ListNamespaces returns the list of available namespaces, optionally filtering by a // parent namespace ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error) // CreateNamespace tells the catalog to create a new namespace with the given properties CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error // DropNamespace tells the catalog to drop the namespace and all tables in that namespace DropNamespace(ctx context.Context, namespace table.Identifier) error // LoadNamespaceProperties returns the current properties in the catalog for // a given namespace LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error) // UpdateNamespaceProperties allows removing, adding, and/or updating properties of a namespace UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, updates iceberg.Properties) (PropertiesUpdateSummary, error) }
Catalog for iceberg table operations like create, drop, load, list and others.
type CatalogType ¶
type CatalogType string
const ( REST CatalogType = "rest" Hive CatalogType = "hive" Glue CatalogType = "glue" DynamoDB CatalogType = "dynamodb" SQL CatalogType = "sql" )
type GlueCatalog ¶
type GlueCatalog struct {
// contains filtered or unexported fields
}
func NewGlueCatalog ¶
func NewGlueCatalog(opts ...Option[GlueCatalog]) *GlueCatalog
func (*GlueCatalog) CatalogType ¶
func (c *GlueCatalog) CatalogType() CatalogType
func (*GlueCatalog) CreateNamespace ¶
func (c *GlueCatalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
func (*GlueCatalog) DropNamespace ¶
func (c *GlueCatalog) DropNamespace(ctx context.Context, namespace table.Identifier) error
func (*GlueCatalog) DropTable ¶
func (c *GlueCatalog) DropTable(ctx context.Context, identifier table.Identifier) error
func (*GlueCatalog) ListNamespaces ¶
func (c *GlueCatalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
func (*GlueCatalog) ListTables ¶
func (c *GlueCatalog) ListTables(ctx context.Context, namespace table.Identifier) ([]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 (*GlueCatalog) LoadNamespaceProperties ¶
func (c *GlueCatalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
func (*GlueCatalog) LoadTable ¶
func (c *GlueCatalog) 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 (*GlueCatalog) RenameTable ¶
func (c *GlueCatalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)
func (*GlueCatalog) UpdateNamespaceProperties ¶
func (c *GlueCatalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, updates iceberg.Properties) (PropertiesUpdateSummary, error)
type Option ¶
type Option[T GlueCatalog | RestCatalog] func(*options)
func WithAuthURI ¶
func WithAuthURI(uri *url.URL) Option[RestCatalog]
func WithAwsConfig ¶
func WithAwsConfig(cfg aws.Config) Option[GlueCatalog]
WithAwsConfig sets the AWS configuration for the catalog.
func WithCredential ¶
func WithCredential(cred string) Option[RestCatalog]
func WithMetadataLocation ¶
func WithMetadataLocation(loc string) Option[RestCatalog]
func WithOAuthToken ¶
func WithOAuthToken(token string) Option[RestCatalog]
func WithPrefix ¶
func WithPrefix(prefix string) Option[RestCatalog]
func WithSigV4 ¶
func WithSigV4() Option[RestCatalog]
func WithSigV4RegionSvc ¶
func WithSigV4RegionSvc(region, service string) Option[RestCatalog]
func WithTLSConfig ¶
func WithTLSConfig(config *tls.Config) Option[RestCatalog]
func WithWarehouseLocation ¶
func WithWarehouseLocation(loc string) Option[RestCatalog]
type PropertiesUpdateSummary ¶
type RestCatalog ¶
type RestCatalog struct {
// contains filtered or unexported fields
}
func NewRestCatalog ¶
func NewRestCatalog(name, uri string, opts ...Option[RestCatalog]) (*RestCatalog, error)
func (*RestCatalog) CatalogType ¶
func (r *RestCatalog) CatalogType() CatalogType
func (*RestCatalog) CreateNamespace ¶
func (r *RestCatalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
func (*RestCatalog) DropNamespace ¶
func (r *RestCatalog) DropNamespace(ctx context.Context, namespace table.Identifier) error
func (*RestCatalog) DropTable ¶
func (r *RestCatalog) DropTable(ctx context.Context, identifier table.Identifier) error
func (*RestCatalog) ListNamespaces ¶
func (r *RestCatalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
func (*RestCatalog) ListTables ¶
func (r *RestCatalog) ListTables(ctx context.Context, namespace table.Identifier) ([]table.Identifier, error)
func (*RestCatalog) LoadNamespaceProperties ¶
func (r *RestCatalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
func (*RestCatalog) LoadTable ¶
func (r *RestCatalog) LoadTable(ctx context.Context, identifier table.Identifier, props iceberg.Properties) (*table.Table, error)
func (*RestCatalog) RenameTable ¶
func (r *RestCatalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)
func (*RestCatalog) UpdateNamespaceProperties ¶
func (r *RestCatalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, updates iceberg.Properties) (PropertiesUpdateSummary, error)
Click to show internal directories.
Click to hide internal directories.