Documentation
¶
Overview ¶
Package catalog provides Catalog implementations for discovering Paimon tables.
Index ¶
- type Catalog
- type FileSystemCatalog
- func (c *FileSystemCatalog) Close() error
- func (c *FileSystemCatalog) GetTable(ctx context.Context, database, tableName string) (*table.FileStoreTable, error)
- func (c *FileSystemCatalog) ListDatabases(ctx context.Context) ([]string, error)
- func (c *FileSystemCatalog) ListTables(ctx context.Context, database string) ([]string, error)
- type Options
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 ¶
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 ¶
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.