icebergcatalogrest

package
v0.0.0-...-de72dcf Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIcebergErrorType

func IsIcebergErrorType(err error, typ IcebergErrorType) bool

Types

type CatalogConfig

type CatalogConfig struct {
	Overrides iceberg.Properties `json:"overrides"`
	Defaults  iceberg.Properties `json:"defaults"`
}

type CatalogREST

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

func NewCatalogREST

func NewCatalogREST(ctx context.Context, baseURL, authToken, warehouse string, clientCatalogProperties map[string]string, logger *zap.Logger) (*CatalogREST, error)

NewCatalogREST connects to a REST Catalog service and returns a Catalog client. The authToken string is either a client secret or a client ID and secret separated by a colon. The properties map contains properties described: https://iceberg.apache.org/docs/1.3.0/configuration/#catalog-properties The returned client is not valid beyond the lifetime of the provided context.

func (*CatalogREST) CreateNamespace

func (c *CatalogREST) CreateNamespace(ctx context.Context, namespace iceberg.Namespace, properties iceberg.Properties) (iceberg.Namespace, iceberg.Properties, error)

func (*CatalogREST) CreateTable

func (c *CatalogREST) CreateTable(
	ctx context.Context,
	tableId iceberg.TableIdentifier,
	location *string,
	schema iceberg.SchemaV2,
	partitionSpec *iceberg.PartitionSpecV2,
	writeOrder *iceberg.SortOrder,
	stageCreate *bool,
	properties *iceberg.Properties,
) (
	table iceberg.Table,
	metadataLocation string,
	tableConfig iceberg.Properties,
	err error,
)

func (*CatalogREST) DropNamespace

func (c *CatalogREST) DropNamespace(ctx context.Context, namespace iceberg.Namespace) error

func (*CatalogREST) DropTable

func (c *CatalogREST) DropTable(ctx context.Context, tableId iceberg.TableIdentifier, purgeDataAndMetadata bool) error

func (*CatalogREST) ListNamespaces

func (c *CatalogREST) ListNamespaces(ctx context.Context, parent iceberg.Namespace) ([]iceberg.Namespace, error)

func (*CatalogREST) ListTables

func (c *CatalogREST) ListTables(ctx context.Context, namespace iceberg.Namespace) ([]iceberg.TableIdentifier, error)

func (*CatalogREST) LoadNamespaceMetadata

func (c *CatalogREST) LoadNamespaceMetadata(ctx context.Context, namespace iceberg.Namespace) (iceberg.Namespace, iceberg.Properties, error)

func (*CatalogREST) LoadTable

func (c *CatalogREST) LoadTable(ctx context.Context, tableId iceberg.TableIdentifier, onlyReferencedSnapshots *bool) (
	table iceberg.Table,
	metadataLocation string,
	tableConfig iceberg.Properties,
	err error,
)

func (*CatalogREST) Properties

func (c *CatalogREST) Properties() map[string]string

func (*CatalogREST) RenameTable

func (c *CatalogREST) RenameTable(ctx context.Context, source, destination iceberg.TableIdentifier) error

func (*CatalogREST) ReportMetrics

func (c *CatalogREST) ReportMetrics() error

func (*CatalogREST) TableExists

func (c *CatalogREST) TableExists(ctx context.Context, tableId iceberg.TableIdentifier) (bool, error)

func (*CatalogREST) UpdateNamespaceProperties

func (c *CatalogREST) UpdateNamespaceProperties(ctx context.Context, namespace iceberg.Namespace, propertyKeysToDelete []string, propertiesToUpdate iceberg.Properties) (updated []string, removed []string, missing []string, err error)

type CreateNamespaceRequest

type CreateNamespaceRequest struct {
	Namespace  iceberg.Namespace  `json:"namespace"`
	Properties iceberg.Properties `json:"properties"`
}

type CreateNamespaceResponse

type CreateNamespaceResponse CreateNamespaceRequest

type CreateTableRequest

type CreateTableRequest struct {
	Name          string                   `json:"name"`
	Location      *string                  `json:"location,omitempty"`
	Schema        *iceberg.SchemaV2        `json:"schema"` // pointer for json.Marshaller
	PartitionSpec *iceberg.PartitionSpecV2 `json:"partition-spec,omitempty"`
	WriteOrder    *iceberg.SortOrder       `json:"write-order,omitempty"`
	StageCreate   *bool                    `json:"stage-create,omitempty"`
	Properties    *iceberg.Properties      `json:"properties,omitempty"`
}

type GetNamespaceResponse

type GetNamespaceResponse CreateNamespaceRequest

type IcebergError

type IcebergError struct {
	ModelError struct {
		Message string           `json:"message"`
		Type    IcebergErrorType `json:"type"`
		Code    int              `json:"code"`
		Stack   []string         `json:"stack"`
	} `json:"error"`
}

https://github.com/apache/iceberg/blob/apache-iceberg-1.3.0/open-api/rest-catalog-open-api.yaml#L2070

func (*IcebergError) Error

func (e *IcebergError) Error() string

type IcebergErrorType

type IcebergErrorType string
const (
	ErrorBadRequest            IcebergErrorType = "BadRequestException"
	ErrorNotAuthorized         IcebergErrorType = "NotAuthorizedException"
	ErrorForbidden             IcebergErrorType = "ForbiddenException"
	ErrorNoSuchX               IcebergErrorType = "NotFoundException"
	ErrorUnsupportedOperation  IcebergErrorType = "UnsupportedOperationException"
	ErrorAlreadyExists         IcebergErrorType = "AlreadyExistsException"
	ErrorAuthenticationTimeout IcebergErrorType = "AuthenticationTimeoutException"
	ErrorRESTException         IcebergErrorType = "RESTException"
	ErrorInternalServerError   IcebergErrorType = "InternalServerError"
	ErrorSlowDown              IcebergErrorType = "SlowDownException"
)

type ListNamespacesResponse

type ListNamespacesResponse struct {
	Namespaces []iceberg.Namespace `json:"namespaces"`
}

type ListTablesResponse

type ListTablesResponse struct {
	Identifiers []iceberg.TableIdentifier `json:"identifiers"`
}

type LoadTableResult

type LoadTableResult struct {
	MetadataLocation *string               `json:"metadata-location,omitempty"`
	Metadata         iceberg.TableMetadata `json:"metadata"`
	Config           iceberg.Properties    `json:"config"`
}

type RenameTableRequest

type RenameTableRequest struct {
	Source      iceberg.TableIdentifier `json:"source"`
	Destination iceberg.TableIdentifier `json:"destination"`
}

type UpdateNamespacePropertiesRequest

type UpdateNamespacePropertiesRequest struct {
	Removals []string           `json:"removals"`
	Updates  iceberg.Properties `json:"updates"`
}

type UpdateNamespacePropertiesResponse

type UpdateNamespacePropertiesResponse struct {
	Updated []string `json:"updated"`
	Removed []string `json:"removed"`
	Missing []string `json:"missing"`
}

Jump to

Keyboard shortcuts

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