catalog

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package catalog provides Catalog implementations for discovering Paimon tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog interface {
	// GetTable returns a FileStoreTable for the given database and table name.
	GetTable(ctx context.Context, database, tableName string) (*table.FileStoreTable, error)

	// ListDatabases returns all database names in the catalog.
	ListDatabases(ctx context.Context) ([]string, error)

	// ListTables returns all table names in the given database.
	ListTables(ctx context.Context, database string) ([]string, error)

	// Close releases resources held by the catalog.
	Close() error
}

Catalog is the interface for accessing Paimon tables.

func New

func New(ctx context.Context, opts Options) (Catalog, error)

New creates a Catalog from the provided options.

opts.Metastore selects the catalog implementation. The only supported value is "filesystem" (case-insensitive); it is also the default when the field is empty. Any other value returns an error.

opts.Warehouse must be set. For GCS use a "gs://bucket/path" URI; for local storage use an absolute path.

type FileSystemCatalog

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

FileSystemCatalog is a path-based catalog that resolves tables from a warehouse directory. Database layout: <warehouse>/<db>.db/<table>

func (*FileSystemCatalog) Close

func (c *FileSystemCatalog) Close() error

Close releases the underlying FileIO.

func (*FileSystemCatalog) GetTable

func (c *FileSystemCatalog) GetTable(ctx context.Context, database, tableName string) (*table.FileStoreTable, error)

GetTable opens a FileStoreTable at <warehouse>/<database>.db/<tableName>. Rather than checking existence via a single object lookup (which fails on GCS because table paths are key prefixes, not objects), we open the table directly and let the schema read produce a clear error if the path does not exist.

func (*FileSystemCatalog) ListDatabases

func (c *FileSystemCatalog) ListDatabases(ctx context.Context) ([]string, error)

ListDatabases lists all <name>.db directories under the warehouse.

func (*FileSystemCatalog) ListTables

func (c *FileSystemCatalog) ListTables(ctx context.Context, database string) ([]string, error)

ListTables lists all table directories under <warehouse>/<database>.db/.

type Options

type Options struct {
	// Warehouse is the root path of the Paimon warehouse.
	// For GCS: "gs://bucket/path/to/warehouse"
	// For local: "/path/to/warehouse"
	Warehouse string

	// Metastore selects the catalog implementation. Currently only "filesystem" is supported.
	Metastore string

	// FileIOOptions are passed through to fileio.New.
	FileIOOptions []fileio.Option
}

Options holds configuration for creating a Catalog.

Jump to

Keyboard shortcuts

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