iceberg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

+marmot:name=Iceberg +marmot:description=This plugin discovers Apache Iceberg tables from various catalog implementations. +marmot:status=experimental

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	plugin.BaseConfig `json:",inline"`

	// Catalog configuration
	CatalogType string `json:"catalog_type" yaml:"catalog_type" description:"Type of catalog to use: rest, glue"`

	// Catalog-specific configurations
	REST *RESTConfig `json:"rest,omitempty" yaml:"rest,omitempty" description:"REST catalog configuration"`
	Glue *GlueConfig `json:"glue,omitempty" yaml:"glue,omitempty" description:"AWS Glue catalog configuration"`

	// Metadata collection options
	IncludeSchemaInfo    bool `json:"include_schema_info" yaml:"include_schema_info" description:"Whether to include schema information in metadata"`
	IncludePartitionInfo bool `` /* 126-byte string literal not displayed */
	IncludeSnapshotInfo  bool `json:"include_snapshot_info" yaml:"include_snapshot_info" description:"Whether to include snapshot information in metadata"`
	IncludeProperties    bool `json:"include_properties" yaml:"include_properties" description:"Whether to include table properties in metadata"`
	IncludeStatistics    bool `json:"include_statistics" yaml:"include_statistics" description:"Whether to include table statistics in metadata"`

	// Filter configuration
	TableFilter     *plugin.Filter `json:"table_filter,omitempty" yaml:"table_filter,omitempty" description:"Filter configuration for tables"`
	NamespaceFilter *plugin.Filter `json:"namespace_filter,omitempty" yaml:"namespace_filter,omitempty" description:"Filter configuration for namespaces"`
}

Config for Iceberg plugin +marmot:config

type GlueConfig

type GlueConfig struct {
	Region             string `json:"region" yaml:"region" description:"AWS region"`
	Database           string `json:"database,omitempty" yaml:"database,omitempty" description:"Default Glue database for narrowing search scope"`
	AccessKey          string `json:"access_key,omitempty" yaml:"access_key,omitempty" description:"AWS access key"`
	SecretKey          string `json:"secret_key,omitempty" yaml:"secret_key,omitempty" description:"AWS secret key"`
	CredentialsProfile string `json:"credentials_profile,omitempty" yaml:"credentials_profile,omitempty" description:"AWS credentials profile name"`
	AssumeRoleARN      string `json:"assume_role_arn,omitempty" yaml:"assume_role_arn,omitempty" description:"AWS role ARN to assume"`
	Endpoint           string `json:"endpoint,omitempty" yaml:"endpoint,omitempty" description:"Optional custom endpoint for Glue service"`
}

GlueConfig for AWS Glue catalog

type IcebergMetadata

type IcebergMetadata struct {
	// Table identity
	Identifier string `json:"identifier"`
	Namespace  string `json:"namespace"`
	TableName  string `json:"table_name"`
	Location   string `json:"location"`

	// Format and version information
	FormatVersion int    `json:"format_version"`
	UUID          string `json:"uuid"`

	// Schema information
	CurrentSchemaID int    `json:"current_schema_id"`
	SchemaJSON      string `json:"schema_json,omitempty"`
	PartitionSpec   string `json:"partition_spec,omitempty"`

	// Snapshot information
	CurrentSnapshotID int64 `json:"current_snapshot_id"`
	LastUpdatedMs     int64 `json:"last_updated_ms"`
	NumSnapshots      int   `json:"num_snapshots,omitempty"`

	// Statistics
	NumRows        int64 `json:"num_rows,omitempty"`
	FileSizeBytes  int64 `json:"file_size_bytes,omitempty"`
	NumDataFiles   int   `json:"num_data_files,omitempty"`
	NumDeleteFiles int   `json:"num_delete_files,omitempty"`

	// Partition information
	NumPartitions         int    `json:"num_partitions,omitempty"`
	PartitionTransformers string `json:"partition_transformers,omitempty"`

	// Properties
	Properties map[string]string `json:"properties,omitempty"`

	// Catalog information
	CatalogType string `json:"catalog_type"`
	CatalogName string `json:"catalog_name,omitempty"`

	// Sort order
	SortOrderJSON string `json:"sort_order_json,omitempty"`
}

IcebergMetadata represents the metadata for an Iceberg table

type IcebergTableFields

type IcebergTableFields struct {
	// Table identity
	Identifier string `json:"identifier" metadata:"identifier" description:"Full identifier of the table (namespace.table_name)"`
	Namespace  string `json:"namespace" metadata:"namespace" description:"Namespace of the table"`
	TableName  string `json:"table_name" metadata:"table_name" description:"Name of the table"`
	Location   string `json:"location" metadata:"location" description:"Base location URI of the table data"`

	// Format and version information
	FormatVersion int    `json:"format_version" metadata:"format_version" description:"Iceberg table format version"`
	UUID          string `json:"uuid" metadata:"uuid" description:"UUID of the table"`

	// Schema information
	CurrentSchemaID int    `json:"current_schema_id" metadata:"current_schema_id" description:"ID of the current schema"`
	SchemaJSON      string `json:"schema_json" metadata:"schema_json" description:"JSON representation of the current schema"`
	PartitionSpec   string `json:"partition_spec" metadata:"partition_spec" description:"JSON representation of the partition specification"`

	// Snapshot information
	CurrentSnapshotID int64  `json:"current_snapshot_id" metadata:"current_snapshot_id" description:"ID of the current snapshot"`
	LastUpdatedMs     int64  `` /* 133-byte string literal not displayed */
	LastCommitTime    string `json:"last_commit_time" metadata:"last_commit_time" description:"Human-readable timestamp when the table was last updated"`
	NumSnapshots      int    `json:"num_snapshots" metadata:"num_snapshots" description:"Number of snapshots in table history"`

	// Statistics
	NumRows        int64 `json:"num_rows" metadata:"num_rows" description:"Number of rows in the table"`
	FileSizeBytes  int64 `json:"file_size_bytes" metadata:"file_size_bytes" description:"Total size of data files in bytes"`
	NumDataFiles   int   `json:"num_data_files" metadata:"num_data_files" description:"Number of data files"`
	NumDeleteFiles int   `json:"num_delete_files" metadata:"num_delete_files" description:"Number of delete files"`

	// Partition information
	NumPartitions         int    `json:"num_partitions" metadata:"num_partitions" description:"Number of partitions"`
	PartitionTransformers string `` /* 148-byte string literal not displayed */

	// Properties
	Properties map[string]string `json:"properties" metadata:"properties" description:"Table properties"`

	// Catalog information
	CatalogType string `json:"catalog_type" metadata:"catalog_type" description:"Type of catalog used (rest, hive, s3, adls, local)"`
	CatalogName string `json:"catalog_name" metadata:"catalog_name" description:"Name of the catalog"`

	// Sort order
	SortOrderJSON string `json:"sort_order_json" metadata:"sort_order_json" description:"JSON representation of the sort order"`

	// Maintenance
	OrphanFilesSizeBytes int64 `json:"orphan_files_size_bytes" metadata:"orphan_files_size_bytes" description:"Size of orphan files in bytes, if available"`
	MaintenanceLastRun   int64 `` /* 149-byte string literal not displayed */
}

IcebergTableFields represents Iceberg table-specific metadata fields +marmot:metadata

type RESTAuthConfig

type RESTAuthConfig struct {
	Type         string `json:"type" yaml:"type" description:"Authentication type: none, basic, oauth2, bearer"`
	Username     string `json:"username,omitempty" yaml:"username,omitempty" description:"Username for basic authentication"`
	Password     string `json:"password,omitempty" yaml:"password,omitempty" description:"Password for basic authentication"`
	Token        string `json:"token,omitempty" yaml:"token,omitempty" description:"Token for bearer authentication"`
	ClientID     string `json:"client_id,omitempty" yaml:"client_id,omitempty" description:"Client ID for OAuth2"`
	ClientSecret string `json:"client_secret,omitempty" yaml:"client_secret,omitempty" description:"Client secret for OAuth2"`
	TokenURL     string `json:"token_url,omitempty" yaml:"token_url,omitempty" description:"Token URL for OAuth2"`
	CertPath     string `json:"cert_path,omitempty" yaml:"cert_path,omitempty" description:"Path to certificate file"`
}

RESTAuthConfig for REST catalog authentication

type RESTConfig

type RESTConfig struct {
	URI  string          `json:"uri" yaml:"uri" description:"URI of the REST catalog"`
	Auth *RESTAuthConfig `json:"auth,omitempty" yaml:"auth,omitempty" description:"Authentication configuration"`
}

RESTConfig for REST catalog

type RESTNamespaceItem

type RESTNamespaceItem struct {
	Namespace string `json:"namespace"`
}

RESTNamespaceItem represents a namespace in the REST catalog

type RESTNamespaceListResponse

type RESTNamespaceListResponse struct {
	Namespaces []RESTNamespaceItem `json:"namespaces"`
}

RESTNamespaceListResponse represents the response structure for namespace list

type RESTTableIdentifier

type RESTTableIdentifier struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
}

RESTTableIdentifier represents a table identifier in the REST catalog

type RESTTableListResponse

type RESTTableListResponse struct {
	Identifiers []RESTTableIdentifier `json:"identifiers"`
}

RESTTableListResponse represents the response structure for table list

type Source

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

Source represents the Iceberg plugin source

func (*Source) Discover

func (s *Source) Discover(ctx context.Context, pluginConfig plugin.RawPluginConfig) (*plugin.DiscoveryResult, error)

func (*Source) Validate

func (s *Source) Validate(rawConfig plugin.RawPluginConfig) error

Jump to

Keyboard shortcuts

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