Documentation
¶
Index ¶
- Variables
- func EmbeddedFuncNames() []string
- func OpenEngineDB() (*sql.DB, error)
- func TranslateEmbedded(query string, resolve func(parts []string) (schema, name string, ok bool), ...) (string, []string, error)
- func TranslateTrino(query string, resolve func(parts []string) (schema, name string, ok bool)) (string, []string, error)
- type ACLConfiguration
- type ApplicationDPUSizes
- type CalculationExecution
- type CalculationResult
- type CalculationStatistics
- type CalculationStatus
- type CalculationSummary
- type CapacityAllocation
- type CapacityAssignment
- type CapacityAssignmentConfiguration
- type CapacityReservation
- type Classification
- type CloudWatchLoggingConfiguration
- type Column
- type ConfigProvider
- type CustomerEncCfg
- type DataCatalog
- type DataCatalogSummary
- type Database
- type EncryptionConfiguration
- type EngineConfiguration
- type EngineLimits
- type EngineVersion
- type EngineVersionDescriptor
- type Executor
- type GlueDatabase
- type GlueMetadataSource
- type GluePartitionDef
- type GlueTable
- type GlueTableCatalog
- type GlueTableDef
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) EnableRegions(ctx context.Context)
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) RegionHandler(region string) *Handler
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) SetGlueSourceFactory(f func(region string) GlueMetadataSource)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- func (h *Handler) WithJanitor(interval, executionTTL time.Duration, taskTimeout ...time.Duration) *Handler
- type IdentityCenterConfiguration
- type InMemoryBackend
- func (b *InMemoryBackend) BatchGetNamedQuery(ids []string) ([]NamedQuery, []UnprocessedNamedQueryID)
- func (b *InMemoryBackend) BatchGetPreparedStatement(workGroup string, names []string) ([]PreparedStatement, []UnprocessedPreparedStatementName)
- func (b *InMemoryBackend) BatchGetQueryExecution(ids []string) ([]QueryExecution, []UnprocessedQueryExecutionID)
- func (b *InMemoryBackend) CancelCapacityReservation(name string) error
- func (b *InMemoryBackend) CreateCapacityReservation(name string, targetDPUs int32, tags map[string]string) error
- func (b *InMemoryBackend) CreateDataCatalog(name, catalogType, description string, params, tags map[string]string) (*DataCatalog, error)
- func (b *InMemoryBackend) CreateNamedQuery(name, description, database, queryString, workGroup string) (string, error)
- func (b *InMemoryBackend) CreateNotebook(workGroup, name string) (string, error)
- func (b *InMemoryBackend) CreatePreparedStatement(name, description, workGroup, queryStatement string) error
- func (b *InMemoryBackend) CreatePresignedNotebookURL(sessionID string) (string, string, float64, error)
- func (b *InMemoryBackend) CreateWorkGroup(name, description, state string, cfg WorkGroupConfiguration, ...) error
- func (b *InMemoryBackend) DeleteCapacityReservation(name string) error
- func (b *InMemoryBackend) DeleteDataCatalog(name string, deleteCatalogOnly bool) (*DataCatalog, error)
- func (b *InMemoryBackend) DeleteNamedQuery(id string) error
- func (b *InMemoryBackend) DeleteNotebook(notebookID string) error
- func (b *InMemoryBackend) DeletePreparedStatement(name, workGroup string) error
- func (b *InMemoryBackend) DeleteWorkGroup(name string, recursiveDelete bool) error
- func (b *InMemoryBackend) ExportNotebook(notebookID string) (NotebookMetadata, string, error)
- func (b *InMemoryBackend) GetCalculationExecution(id string) (*CalculationExecution, error)
- func (b *InMemoryBackend) GetCalculationExecutionCode(id string) (string, error)
- func (b *InMemoryBackend) GetCalculationExecutionStatus(id string) (CalculationStatus, CalculationStatistics, error)
- func (b *InMemoryBackend) GetCapacityAssignmentConfiguration(name string) (*CapacityAssignmentConfiguration, error)
- func (b *InMemoryBackend) GetCapacityReservation(name string) (*CapacityReservation, error)
- func (b *InMemoryBackend) GetDataCatalog(name string) (*DataCatalog, error)
- func (b *InMemoryBackend) GetDatabase(catalog, name string) (*Database, error)
- func (b *InMemoryBackend) GetNamedQuery(id string) (*NamedQuery, error)
- func (b *InMemoryBackend) GetNotebookMetadata(notebookID string) (*NotebookMetadata, error)
- func (b *InMemoryBackend) GetPreparedStatement(name, workGroup string) (*PreparedStatement, error)
- func (b *InMemoryBackend) GetQueryExecution(id string) (*QueryExecution, error)
- func (b *InMemoryBackend) GetQueryResults(id, nextToken string, maxResults int) (*SQLResultPage, error)
- func (b *InMemoryBackend) GetQueryRuntimeStatistics(id string) (*QueryRuntimeStatistics, error)
- func (b *InMemoryBackend) GetResourceDashboard(resourceARN string) (string, error)
- func (b *InMemoryBackend) GetSession(id string) (*Session, error)
- func (b *InMemoryBackend) GetSessionEndpoint(id string) (string, string, float64, error)
- func (b *InMemoryBackend) GetSessionStatus(id string) (SessionStatus, error)
- func (b *InMemoryBackend) GetTableMetadata(catalog, database, table string) (*TableMetadata, error)
- func (b *InMemoryBackend) GetWorkGroup(name string) (*WorkGroup, error)
- func (b *InMemoryBackend) ImportNotebook(workGroup, name, payload, notebookType string) (string, error)
- func (b *InMemoryBackend) InsertRows(catalog, database, table string, rows []map[string]any)
- func (b *InMemoryBackend) InventoryResources() []TaggedEntry
- func (b *InMemoryBackend) ListApplicationDPUSizes() []ApplicationDPUSizes
- func (b *InMemoryBackend) ListCalculationExecutions(sessionID, stateFilter string) ([]CalculationSummary, error)
- func (b *InMemoryBackend) ListCapacityReservations() ([]CapacityReservation, error)
- func (b *InMemoryBackend) ListDataCatalogs(nextToken string, maxResults int) ([]*DataCatalogSummary, string, error)
- func (b *InMemoryBackend) ListDatabases(catalog string) ([]Database, error)
- func (b *InMemoryBackend) ListEngineVersions() []EngineVersionDescriptor
- func (b *InMemoryBackend) ListExecutors(sessionID, stateFilter string) ([]Executor, error)
- func (b *InMemoryBackend) ListNamedQueries(workGroup, nextToken string, maxResults int) ([]string, string, error)
- func (b *InMemoryBackend) ListNotebookMetadata(workGroup, namePrefix string) ([]NotebookMetadata, error)
- func (b *InMemoryBackend) ListNotebookSessions(notebookID string) ([]NotebookSessionSummary, error)
- func (b *InMemoryBackend) ListPreparedStatements(workGroup, nextToken string, maxResults int) ([]PreparedStatementSummary, string, error)
- func (b *InMemoryBackend) ListQueryExecutions(workGroup string) ([]string, error)
- func (b *InMemoryBackend) ListSessions(workGroup, stateFilter string) ([]SessionSummary, error)
- func (b *InMemoryBackend) ListTableMetadata(catalog, database, expr string) ([]TableMetadata, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN, nextToken string, maxResults int) ([]Tag, string, error)
- func (b *InMemoryBackend) ListWorkGroups(nextToken string, maxResults int) ([]*WorkGroupSummary, string, error)
- func (b *InMemoryBackend) PutCapacityAssignmentConfiguration(name string, assignments []CapacityAssignment) error
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) SetEngineLimits(l EngineLimits)
- func (b *InMemoryBackend) SetGlueMetadataSource(src GlueMetadataSource)
- func (b *InMemoryBackend) SetS3Backend(s3 S3Storer)
- func (b *InMemoryBackend) SetS3TablesSource(src S3TablesSource)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartCalculationExecution(sessionID, description, codeBlock string) (string, string, error)
- func (b *InMemoryBackend) StartQueryExecution(query, workGroup string, ctx QueryExecutionContext, rc ResultConfiguration, ...) (string, error)
- func (b *InMemoryBackend) StartSession(workGroup, description, notebookVersion string, engineCfg EngineConfiguration, ...) (string, string, error)
- func (b *InMemoryBackend) StopCalculationExecution(id string) (string, error)
- func (b *InMemoryBackend) StopQueryExecution(id string) error
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) TagSession(sessionID string, copyWorkGroupTags bool, tags map[string]string) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) TerminateSession(id string) (string, error)
- func (b *InMemoryBackend) UntagResource(resourceARN string, keys []string) error
- func (b *InMemoryBackend) UpdateCapacityReservation(name string, targetDPUs int32) error
- func (b *InMemoryBackend) UpdateDataCatalog(name, catalogType, description string, params map[string]string) error
- func (b *InMemoryBackend) UpdateNamedQuery(id, name, description, queryString string) error
- func (b *InMemoryBackend) UpdateNotebook(notebookID, payload, notebookType, sessionID string) error
- func (b *InMemoryBackend) UpdateNotebookMetadata(notebookID, newName string) error
- func (b *InMemoryBackend) UpdatePreparedStatement(name, workGroup, queryStatement, description string) error
- func (b *InMemoryBackend) UpdateWorkGroup(name, description, state string, cfg *WorkGroupConfigurationUpdates) error
- type Janitor
- type ManagedLoggingConfiguration
- type ManagedQueryResultsConfiguration
- type ManagedResultsEncryption
- type ManagedResultsUpdates
- type MonitoringConfiguration
- type NamedQuery
- type Notebook
- type NotebookMetadata
- type NotebookSessionSummary
- type PreparedStatement
- type PreparedStatementSummary
- type Provider
- type QueryExecution
- type QueryExecutionContext
- type QueryExecutionError
- type QueryExecutionStatistics
- type QueryExecutionStatus
- type QueryRuntimeStatistics
- type QueryRuntimeStatisticsRows
- type QueryRuntimeStatisticsTimeline
- type QueryStage
- type ResultConfiguration
- type ResultReuseByAgeConfiguration
- type ResultReuseConfiguration
- type ResultReuseInformation
- type S3AccessGrantsConfig
- type S3Deleter
- type S3Getter
- type S3Lister
- type S3LoggingConfiguration
- type S3Storer
- type S3TableInfo
- type S3TablesSource
- type SQLResultPage
- type Session
- type SessionConfiguration
- type SessionStatistics
- type SessionStatus
- type SessionSummary
- type Settings
- type StorageBackend
- type TableMetadata
- type Tag
- type TaggedEntry
- type UnprocessedNamedQueryID
- type UnprocessedPreparedStatementName
- type UnprocessedQueryExecutionID
- type WorkGroup
- type WorkGroupConfiguration
- type WorkGroupConfigurationUpdates
- type WorkGroupSummary
Constants ¶
This section is empty.
Variables ¶
var ( ErrCatalogEntityNotFound = errors.New("catalog entity not found") ErrCatalogEntityExists = errors.New("catalog entity already exists") )
ErrCatalogEntityNotFound and ErrCatalogEntityExists are returned by a GlueTableCatalog for missing and duplicate tables or partitions.
var ( // ErrNotFound is returned when a requested resource that AWS reports via // InvalidRequestException does not exist (workgroups, named queries, data // catalogs, query executions, notebooks, capacity reservations). AWS Athena // returns InvalidRequestException — not a dedicated NotFound code — for these. ErrNotFound = errors.New(errTypeInvalidRequestExc) // ErrAlreadyExists is returned when a resource already exists. AWS Athena // reports duplicate workgroups/catalogs/notebooks as InvalidRequestException. ErrAlreadyExists = errors.New(errTypeInvalidRequestExc) // ErrProtected is returned when an operation is not allowed on a protected // resource (e.g. deleting the primary workgroup). AWS returns // InvalidRequestException for these. ErrProtected = errors.New(errTypeInvalidRequestExc) // ErrValidation is returned when input fails validation // (InvalidRequestException). ErrValidation = errors.New(errTypeInvalidRequestExc) // ErrResourceNotFound is returned for resources AWS reports with the // dedicated ResourceNotFoundException code: sessions, calculation // executions, and prepared statements. ErrResourceNotFound = errors.New(errTypeResourceNotFoundExc) // ErrMetadata is returned when a metadata lookup against the (emulated Glue) // catalog fails — missing databases and tables — which AWS surfaces as // MetadataException. ErrMetadata = errors.New(errTypeMetadataExc) // ErrSessionExists is returned when a session with the same identity already // exists (SessionAlreadyExistsException). ErrSessionExists = errors.New(errTypeSessionExistsExc) )
var ErrCatalogCommitConflict = errors.New("catalog commit conflict")
ErrCatalogCommitConflict is returned when a catalog commit finds the table's metadata location moved since it was read.
var ErrUnknownOperation = errors.New("InvalidRequestException")
Functions ¶
func EmbeddedFuncNames ¶
func EmbeddedFuncNames() []string
EmbeddedFuncNames lists the SQLite names an embedding service can reach through TranslateEmbedded.
func OpenEngineDB ¶
OpenEngineDB opens a private in-memory SQLite database with the Trino function set registered.
func TranslateEmbedded ¶
func TranslateEmbedded( query string, resolve func(parts []string) (schema, name string, ok bool), owned map[string]struct{}, ) (string, []string, error)
TranslateEmbedded is TranslateTrino for a service that embeds the engine: names in owned are left for the host to resolve, and functions Athena adds beyond the shared set stay unresolved.
func TranslateTrino ¶
func TranslateTrino( query string, resolve func(parts []string) (schema, name string, ok bool), ) (string, []string, error)
TranslateTrino rewrites Presto/Trino SQL onto the SQLite engine. resolve maps a table reference to the SQLite schema and table it was loaded into; unresolved references are returned by name.
Types ¶
type ACLConfiguration ¶
type ACLConfiguration struct {
S3AclOption string `json:"S3AclOption,omitempty"`
}
ACLConfiguration controls S3 canned ACL for query results.
type ApplicationDPUSizes ¶
type ApplicationDPUSizes struct {
ApplicationRuntimeID string `json:"ApplicationRuntimeId"`
SupportedDPUSizes []int32 `json:"SupportedDPUSizes,omitempty"`
}
ApplicationDPUSizes lists DPU sizes for a Spark application.
type CalculationExecution ¶
type CalculationExecution struct {
Result CalculationResult `json:"Result,omitzero"`
Statistics CalculationStatistics `json:"Statistics,omitzero"`
CalculationID string `json:"CalculationExecutionId"`
SessionID string `json:"SessionId"`
Description string `json:"Description,omitempty"`
WorkingDir string `json:"WorkingDirectory,omitempty"`
CodeBlock string `json:"CodeBlock,omitempty"`
Status CalculationStatus `json:"Status"`
}
CalculationExecution is a Spark calculation run within a session.
type CalculationResult ¶
type CalculationResult struct {
StdOutS3URI string `json:"StdOutS3Uri,omitempty"`
StdErrorS3URI string `json:"StdErrorS3Uri,omitempty"`
ResultS3URI string `json:"ResultS3Uri,omitempty"`
ResultType string `json:"ResultType,omitempty"`
}
CalculationResult holds output references for a calculation.
type CalculationStatistics ¶
type CalculationStatistics struct {
Progress string `json:"Progress,omitempty"`
DpuExecutionInMillis int64 `json:"DpuExecutionInMillis,omitempty"`
}
CalculationStatistics holds calculation runtime stats. Progress is a string on the real shape (types.go), not a number -- the deserializer's case "Progress" type-switches on value.(string), so a numeric Progress fails every real client's decode outright.
type CalculationStatus ¶
type CalculationStatus struct {
StateChangeReason string `json:"StateChangeReason,omitempty"`
State string `json:"State"`
SubmissionDateTime float64 `json:"SubmissionDateTime,omitempty"`
CompletionDateTime float64 `json:"CompletionDateTime,omitempty"`
}
CalculationStatus holds the lifecycle of a calculation.
type CalculationSummary ¶
type CalculationSummary struct {
CalculationID string `json:"CalculationExecutionId"`
Description string `json:"Description,omitempty"`
Status CalculationStatus `json:"Status,omitzero"`
}
CalculationSummary is the list view of a calculation execution.
type CapacityAllocation ¶
type CapacityAllocation struct {
Status string `json:"Status,omitempty"`
StatusMessage string `json:"StatusMessage,omitempty"`
RequestTime float64 `json:"RequestTime,omitempty"`
RequestCompletionTime float64 `json:"RequestCompletionTime,omitempty"`
}
CapacityAllocation describes a single capacity allocation attempt.
type CapacityAssignment ¶
type CapacityAssignment struct {
WorkGroupNames []string `json:"WorkGroupNames"`
}
CapacityAssignment maps a list of workgroup ARNs to a reservation.
type CapacityAssignmentConfiguration ¶
type CapacityAssignmentConfiguration struct {
CapacityReservationName string `json:"CapacityReservationName"`
CapacityAssignments []CapacityAssignment `json:"CapacityAssignments,omitempty"`
}
CapacityAssignmentConfiguration is the config attached to a capacity reservation.
type CapacityReservation ¶
type CapacityReservation struct {
LastAllocation *CapacityAllocation `json:"LastAllocation,omitempty"`
Name string `json:"Name"`
Status string `json:"Status"`
CreationTime float64 `json:"CreationTime,omitempty"`
LastSuccessfulAllocationTime float64 `json:"LastSuccessfulAllocationTime,omitempty"`
TargetDpus int32 `json:"TargetDpus"`
AllocatedDpus int32 `json:"AllocatedDpus"`
}
CapacityReservation represents an Athena capacity reservation.
AWS's real types.CapacityReservation carries no Tags field -- tags live only in TagResource/ListTagsForResource's separate store; see WorkGroup's doc comment for the same rule.
type Classification ¶
type Classification struct {
Properties map[string]string `json:"Properties,omitempty"`
Name string `json:"Name,omitempty"`
}
Classification is a named set of configuration properties applied to a session's engine (aws-sdk-go-v2/service/athena/types.Classification).
type CloudWatchLoggingConfiguration ¶ added in v1.3.1
type CloudWatchLoggingConfiguration struct {
LogGroup string `json:"LogGroup,omitempty"`
Enabled bool `json:"Enabled,omitempty"`
}
CloudWatchLoggingConfiguration controls delivery of session logs to CloudWatch.
type Column ¶
type Column struct {
Name string `json:"Name"`
Type string `json:"Type,omitempty"`
Comment string `json:"Comment,omitempty"`
}
Column describes a single column in a table.
type ConfigProvider ¶
type ConfigProvider interface {
GetAthenaSettings() Settings
}
ConfigProvider is a private interface to extract Athena configuration from the abstract AppContext Config.
type CustomerEncCfg ¶
type CustomerEncCfg struct {
KmsKey string `json:"KmsKey,omitempty"`
}
CustomerEncCfg holds KMS key for user data encryption.
type DataCatalog ¶
type DataCatalog struct {
Parameters map[string]string `json:"Parameters,omitempty"`
Name string `json:"Name"`
Type string `json:"Type"`
Description string `json:"Description,omitempty"`
ConnectionType string `json:"ConnectionType,omitempty"`
Error string `json:"Error,omitempty"`
Status string `json:"Status,omitempty"`
}
DataCatalog represents an Athena data catalog.
AWS's real types.DataCatalog carries no Tags field -- tags live only in TagResource/ListTagsForResource's separate store; see WorkGroup's doc comment for the same rule.
type DataCatalogSummary ¶
type DataCatalogSummary struct {
CatalogName string `json:"CatalogName"`
Type string `json:"Type"`
ConnectionType string `json:"ConnectionType,omitempty"`
Error string `json:"Error,omitempty"`
Status string `json:"Status,omitempty"`
}
DataCatalogSummary is a reduced view of a DataCatalog for list responses.
type Database ¶
type Database struct {
Parameters map[string]string `json:"Parameters,omitempty"`
Name string `json:"Name"`
// Catalog is the data catalog this database belongs to. It is the first
// component of the composite key store.Table's keyFn derives (see
// databaseKeyFn in store_setup.go) and of the databasesByCatalog
// secondary index -- Database itself carries no other notion of which
// catalog it lives in, since AWS's own Database shape does not either.
// Tagged json:"-" because a real persistence layer would round-trip it
// through a dedicated DTO (see services/ses's IdentityRecord.Identity for
// the established pattern) rather than relying on this field surviving a
// direct JSON marshal.
Catalog string `json:"-"`
Description string `json:"Description,omitempty"`
}
Database describes an Athena database.
type EncryptionConfiguration ¶
type EncryptionConfiguration struct {
EncryptionOption string `json:"EncryptionOption,omitempty"`
KmsKey string `json:"KmsKey,omitempty"`
}
EncryptionConfiguration holds encryption settings for query results.
type EngineConfiguration ¶
type EngineConfiguration struct {
AdditionalConfigs map[string]string `json:"AdditionalConfigs,omitempty"`
SparkProperties map[string]string `json:"SparkProperties,omitempty"`
Classifications []Classification `json:"Classifications,omitempty"`
DefaultExecutorDpuSize int32 `json:"DefaultExecutorDpuSize,omitempty"`
MaxConcurrentDpus int32 `json:"MaxConcurrentDpus,omitempty"`
CoordinatorDpuSize int32 `json:"CoordinatorDpuSize,omitempty"`
}
EngineConfiguration is the engine configuration for a session or workgroup. Real types.EngineConfiguration is shared verbatim between Session and WorkGroupConfiguration (a single generated type, confirmed via athena@v1.60.4/types/types.go), so this one model backs both.
type EngineLimits ¶
type EngineLimits struct {
MaxLoadedRows int
MaxResultRows int
MaxResultBytes int64
MaxScanBytes int64
QueryTimeout time.Duration
}
EngineLimits bounds a query's resource use; zero fields keep the defaults.
type EngineVersion ¶
type EngineVersion struct {
SelectedEngineVersion string `json:"SelectedEngineVersion,omitempty"`
EffectiveEngineVersion string `json:"EffectiveEngineVersion,omitempty"`
}
EngineVersion holds the engine version configuration for a workgroup.
type EngineVersionDescriptor ¶
type EngineVersionDescriptor struct {
EffectiveEngineVersion string `json:"EffectiveEngineVersion,omitempty"`
SelectedEngineVersion string `json:"SelectedEngineVersion,omitempty"`
}
EngineVersionDescriptor describes an available engine version.
This mirrors AWS's real types.EngineVersion exactly (EffectiveEngineVersion + SelectedEngineVersion only). A previous "AuthEngineVersion" field here was a gopherstack invention with no counterpart on the real type -- removed.
type Executor ¶
type Executor struct {
ExecutorID string `json:"ExecutorId"`
ExecutorType string `json:"ExecutorType"`
ExecutorState string `json:"ExecutorState"`
StartDateTime int64 `json:"StartDateTime,omitempty"`
TerminationDateTime int64 `json:"TerminationDateTime,omitempty"`
ExecutorSize int64 `json:"ExecutorSize,omitempty"`
}
Executor describes a Spark executor. StartDateTime/TerminationDateTime are plain epoch-seconds *int64 on the real wire (athena@v1.60.4 types.go's ExecutorsSummary), NOT a smithy timestamp -- their deserializer calls strconv.ParseInt, which errors on a fractional value, unlike the time.Time-typed epoch fields elsewhere in this package.
type GlueDatabase ¶
GlueDatabase is the subset of a Glue database's fields Athena needs to present a GLUE-type catalog's database, wired via SetGlueMetadataSource.
type GlueMetadataSource ¶
type GlueMetadataSource interface {
GetDatabase(name string) (*GlueDatabase, error)
GetDatabases() []*GlueDatabase
GetTable(dbName, tableName string) (*GlueTable, error)
GetTables(dbName string) ([]*GlueTable, error)
// CreateDatabase and DeleteDatabase let Athena's CREATE/DROP DATABASE DDL
// mutate the real Glue catalog for a GLUE-type DataCatalog, matching the
// read side above -- without these, a database created by DDL against a
// glue-backed catalog was invisible to GetDatabase/ListDatabases (both
// glue-routed), since the DDL path wrote only to Athena's own simulated
// store.
CreateDatabase(name, description string) error
DeleteDatabase(name string) error
}
GlueMetadataSource is the subset of Glue operations that Athena needs to resolve a GLUE-type DataCatalog's databases and tables against real Glue state, wired via SetGlueMetadataSource. When unset, GLUE-type catalogs fall back to Athena's own internally simulated database/table store.
type GluePartitionDef ¶
GluePartitionDef is a registered partition's key values and S3 location.
type GlueTable ¶
type GlueTable struct {
Name string
Parameters map[string]string
Columns []Column
PartitionKeys []Column
CreateTime float64
}
GlueTable is the subset of a Glue table's fields Athena needs to present a GLUE-type catalog's table, wired via SetGlueMetadataSource.
type GlueTableCatalog ¶
type GlueTableCatalog interface {
GetTableDef(db, name string) (*GlueTableDef, error)
GetPartitionDefs(db, name string) ([]GluePartitionDef, error)
CreateTableDef(db string, def GlueTableDef) error
DeleteTable(db, name string) error
CreatePartitionDefs(db, table string, parts []GluePartitionDef) error
}
GlueTableCatalog is the optional table-level side of the wired GlueMetadataSource; without it the SQL engine stays inactive.
type GlueTableDef ¶
type GlueTableDef struct {
Parameters map[string]string
SerdeParameters map[string]string
Name string
TableType string
Location string
SerdeLibrary string
InputFormat string
OutputFormat string
Columns []Column
PartitionKeys []Column
}
GlueTableDef is the storage-level view of a Glue table the SQL engine reads.
type Handler ¶
type Handler struct {
Backend StorageBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP service handler for Athena operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Athena handler with the given storage backend.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this Athena instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) EnableRegions ¶
EnableRegions makes h serve every other region through lazily built per-region siblings, each with its own janitor running under ctx.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the specific Athena operation from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource name from the request body. It decodes only the "Name" field rather than the whole body: httputils.ReadBody caches and rewinds the body, so this does not conflict with the dispatcher's own read, and the typed decode avoids allocating a map for every field.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of mocked Athena operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo HTTP handler for Athena operations.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority for the Athena handler.
func (*Handler) RegionHandler ¶
RegionHandler returns the handler serving region: h itself for the home region, else its sibling.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches incoming requests for Athena.
func (*Handler) SetGlueSourceFactory ¶
func (h *Handler) SetGlueSourceFactory(f func(region string) GlueMetadataSource)
SetGlueSourceFactory sets how sibling regions resolve their Glue catalog.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.
func (*Handler) StartWorker ¶
StartWorker starts the background janitor if configured.
type IdentityCenterConfiguration ¶
type IdentityCenterConfiguration struct {
EnableIdentityCenter *bool `json:"EnableIdentityCenter,omitempty"`
IdentityCenterInstanceArn string `json:"IdentityCenterInstanceArn,omitempty"`
}
IdentityCenterConfiguration mirrors types.IdentityCenterConfiguration.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend implements StorageBackend using in-memory maps.
Every AWS resource collection is a *store.Table[T] registered on registry (see store_setup.go for the full split between tables registered directly and the two "dirty" tables handled separately); queryResults, tableData, and resourceTags remain plain maps -- see the store_setup.go file doc for why each is left as-is.
func NewInMemoryBackend ¶
func NewInMemoryBackend(region, accountID string) *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend and seeds the default "primary" workgroup.
func (*InMemoryBackend) BatchGetNamedQuery ¶
func (b *InMemoryBackend) BatchGetNamedQuery( ids []string, ) ([]NamedQuery, []UnprocessedNamedQueryID)
BatchGetNamedQuery retrieves multiple named queries by ID.
func (*InMemoryBackend) BatchGetPreparedStatement ¶
func (b *InMemoryBackend) BatchGetPreparedStatement( workGroup string, names []string, ) ([]PreparedStatement, []UnprocessedPreparedStatementName)
BatchGetPreparedStatement retrieves multiple prepared statements by name within a workgroup.
func (*InMemoryBackend) BatchGetQueryExecution ¶
func (b *InMemoryBackend) BatchGetQueryExecution( ids []string, ) ([]QueryExecution, []UnprocessedQueryExecutionID)
BatchGetQueryExecution retrieves multiple query executions by ID.
func (*InMemoryBackend) CancelCapacityReservation ¶
func (b *InMemoryBackend) CancelCapacityReservation(name string) error
CancelCapacityReservation cancels an active capacity reservation. Real AWS transitions ACTIVE -> CANCELLING -> CANCELLED asynchronously; this emulator has no ticking mechanism to advance a reservation on its own, so it goes straight to CANCELLED (synchronous, always succeeds -- same emulation choice already made for e.g. StartSchemaMerge). Leaving it at CANCELLING forever previously made terraform-provider-aws's delete waiter (Pending: ACTIVE/CANCELLING, Target: CANCELLED) poll for its full 30-minute default delete timeout on every aws_athena_capacity_reservation destroy.
func (*InMemoryBackend) CreateCapacityReservation ¶
func (b *InMemoryBackend) CreateCapacityReservation( name string, targetDPUs int32, tags map[string]string, ) error
CreateCapacityReservation creates a new capacity reservation.
func (*InMemoryBackend) CreateDataCatalog ¶
func (b *InMemoryBackend) CreateDataCatalog( name, catalogType, description string, params, tags map[string]string, ) (*DataCatalog, error)
CreateDataCatalog creates a new data catalog and returns a copy of the created record. The real CreateDataCatalogOutput carries an optional DataCatalog field with the newly created catalog; the handler wires the returned pointer straight into that response field.
func (*InMemoryBackend) CreateNamedQuery ¶
func (b *InMemoryBackend) CreateNamedQuery( name, description, database, queryString, workGroup string, ) (string, error)
CreateNamedQuery creates a new named query and returns its ID.
func (*InMemoryBackend) CreateNotebook ¶
func (b *InMemoryBackend) CreateNotebook(workGroup, name string) (string, error)
CreateNotebook creates a new Athena notebook and returns its ID.
The real CreateNotebookInput carries only Name/WorkGroup/ClientRequestToken -- no Tags field (unlike CreateWorkGroup/CreateDataCatalog/ CreateCapacityReservation, which all accept Tags at creation time). A notebook can still be tagged after creation via TagResource against its ARN.
func (*InMemoryBackend) CreatePreparedStatement ¶
func (b *InMemoryBackend) CreatePreparedStatement( name, description, workGroup, queryStatement string, ) error
CreatePreparedStatement creates a new prepared statement in a workgroup.
func (*InMemoryBackend) CreatePresignedNotebookURL ¶
func (b *InMemoryBackend) CreatePresignedNotebookURL(sessionID string) (string, string, float64, error)
CreatePresignedNotebookURL generates a presigned notebook URL plus the AuthToken/AuthTokenExpirationTime pair the real CreatePresignedNotebookUrl response carries alongside it.
func (*InMemoryBackend) CreateWorkGroup ¶
func (b *InMemoryBackend) CreateWorkGroup( name, description, state string, cfg WorkGroupConfiguration, tags map[string]string, ) error
CreateWorkGroup creates a new workgroup.
func (*InMemoryBackend) DeleteCapacityReservation ¶
func (b *InMemoryBackend) DeleteCapacityReservation(name string) error
DeleteCapacityReservation removes a capacity reservation. The reservation must be in CANCELLING or CANCELLED status.
func (*InMemoryBackend) DeleteDataCatalog ¶
func (b *InMemoryBackend) DeleteDataCatalog(name string, deleteCatalogOnly bool) (*DataCatalog, error)
DeleteDataCatalog removes a data catalog by name and returns a copy of the record as it existed immediately before deletion. The real DeleteDataCatalogOutput carries an optional DataCatalog field with the deleted catalog; the handler wires the returned pointer straight into that response field. The built-in AwsDataCatalog cannot be deleted.
deleteCatalogOnly is only valid for FEDERATED catalogs (real AWS tears down the CFN stack, Lambda connector, and Glue connection behind a FEDERATED catalog unless it's set; gopherstack models none of those, so once validated the flag has nothing left to control).
func (*InMemoryBackend) DeleteNamedQuery ¶
func (b *InMemoryBackend) DeleteNamedQuery(id string) error
DeleteNamedQuery removes a named query by ID.
func (*InMemoryBackend) DeleteNotebook ¶
func (b *InMemoryBackend) DeleteNotebook(notebookID string) error
DeleteNotebook removes a notebook by its ID.
func (*InMemoryBackend) DeletePreparedStatement ¶
func (b *InMemoryBackend) DeletePreparedStatement(name, workGroup string) error
DeletePreparedStatement removes a prepared statement by name and workgroup.
func (*InMemoryBackend) DeleteWorkGroup ¶
func (b *InMemoryBackend) DeleteWorkGroup(name string, recursiveDelete bool) error
DeleteWorkGroup removes a workgroup by name. The "primary" workgroup cannot be deleted.
recursiveDelete mirrors DeleteWorkGroupInput.RecursiveDeleteOption: "The option to delete the workgroup and its contents even if the workgroup contains any named queries, query executions, or notebooks." (aws-sdk-go-v2/service/athena@v1.60.4 api_op_DeleteWorkGroup.go). When false and the workgroup still has any of those, deletion is rejected instead of silently orphaning them; when true, they are cascade-deleted along with the workgroup.
func (*InMemoryBackend) ExportNotebook ¶
func (b *InMemoryBackend) ExportNotebook(notebookID string) (NotebookMetadata, string, error)
ExportNotebook returns the notebook metadata and content for the given notebook ID.
func (*InMemoryBackend) GetCalculationExecution ¶
func (b *InMemoryBackend) GetCalculationExecution(id string) (*CalculationExecution, error)
GetCalculationExecution returns a calculation execution by ID.
func (*InMemoryBackend) GetCalculationExecutionCode ¶
func (b *InMemoryBackend) GetCalculationExecutionCode(id string) (string, error)
GetCalculationExecutionCode returns just the code block of a calculation.
func (*InMemoryBackend) GetCalculationExecutionStatus ¶
func (b *InMemoryBackend) GetCalculationExecutionStatus(id string) (CalculationStatus, CalculationStatistics, error)
GetCalculationExecutionStatus returns just the status of a calculation.
func (*InMemoryBackend) GetCapacityAssignmentConfiguration ¶
func (b *InMemoryBackend) GetCapacityAssignmentConfiguration(name string) (*CapacityAssignmentConfiguration, error)
GetCapacityAssignmentConfiguration returns the assignment configuration for a reservation.
func (*InMemoryBackend) GetCapacityReservation ¶
func (b *InMemoryBackend) GetCapacityReservation(name string) (*CapacityReservation, error)
GetCapacityReservation returns a capacity reservation.
func (*InMemoryBackend) GetDataCatalog ¶
func (b *InMemoryBackend) GetDataCatalog(name string) (*DataCatalog, error)
GetDataCatalog retrieves a data catalog by name.
func (*InMemoryBackend) GetDatabase ¶
func (b *InMemoryBackend) GetDatabase(catalog, name string) (*Database, error)
GetDatabase returns a database by catalog and name.
func (*InMemoryBackend) GetNamedQuery ¶
func (b *InMemoryBackend) GetNamedQuery(id string) (*NamedQuery, error)
GetNamedQuery retrieves a named query by ID.
func (*InMemoryBackend) GetNotebookMetadata ¶
func (b *InMemoryBackend) GetNotebookMetadata(notebookID string) (*NotebookMetadata, error)
GetNotebookMetadata returns the metadata for a notebook by ID.
func (*InMemoryBackend) GetPreparedStatement ¶
func (b *InMemoryBackend) GetPreparedStatement(name, workGroup string) (*PreparedStatement, error)
GetPreparedStatement retrieves a prepared statement by name and workgroup.
func (*InMemoryBackend) GetQueryExecution ¶
func (b *InMemoryBackend) GetQueryExecution(id string) (*QueryExecution, error)
GetQueryExecution retrieves a query execution by ID.
func (*InMemoryBackend) GetQueryResults ¶
func (b *InMemoryBackend) GetQueryResults(id, nextToken string, maxResults int) (*SQLResultPage, error)
GetQueryResults returns a paginated result page for a query execution. nextToken is a decimal-encoded row offset; empty string means start from 0. maxResults = 0 means "use default page size (1000)".
func (*InMemoryBackend) GetQueryRuntimeStatistics ¶
func (b *InMemoryBackend) GetQueryRuntimeStatistics(id string) (*QueryRuntimeStatistics, error)
GetQueryRuntimeStatistics returns runtime statistics for a query execution.
func (*InMemoryBackend) GetResourceDashboard ¶
func (b *InMemoryBackend) GetResourceDashboard(resourceARN string) (string, error)
GetResourceDashboard returns a session's dashboard URL. Real AWS declares ResourceNotFoundException for an unknown session (api_op_GetResourceDashboard.go).
func (*InMemoryBackend) GetSession ¶
func (b *InMemoryBackend) GetSession(id string) (*Session, error)
GetSession returns the session matching the given ID.
func (*InMemoryBackend) GetSessionEndpoint ¶
GetSessionEndpoint returns a presigned endpoint URL for the given session, plus the AuthToken/AuthTokenExpirationTime pair the real GetSessionEndpoint response carries alongside it.
func (*InMemoryBackend) GetSessionStatus ¶
func (b *InMemoryBackend) GetSessionStatus(id string) (SessionStatus, error)
GetSessionStatus returns just the status for the session.
func (*InMemoryBackend) GetTableMetadata ¶
func (b *InMemoryBackend) GetTableMetadata(catalog, database, table string) (*TableMetadata, error)
GetTableMetadata returns the metadata for a single table.
func (*InMemoryBackend) GetWorkGroup ¶
func (b *InMemoryBackend) GetWorkGroup(name string) (*WorkGroup, error)
GetWorkGroup retrieves a workgroup by name.
func (*InMemoryBackend) ImportNotebook ¶
func (b *InMemoryBackend) ImportNotebook(workGroup, name, payload, notebookType string) (string, error)
ImportNotebook creates a new notebook from inline payload.
func (*InMemoryBackend) InsertRows ¶
func (b *InMemoryBackend) InsertRows(catalog, database, table string, rows []map[string]any)
InsertRows loads test data into a table for SQL execution. Rows are maps of column-name → value. All values are stored as-is and converted to strings when returned by GetQueryResults.
func (*InMemoryBackend) InventoryResources ¶
func (b *InMemoryBackend) InventoryResources() []TaggedEntry
InventoryResources lists every workgroup, data catalog, capacity reservation and session plus every tagged ARN of the tag store.
func (*InMemoryBackend) ListApplicationDPUSizes ¶
func (b *InMemoryBackend) ListApplicationDPUSizes() []ApplicationDPUSizes
ListApplicationDPUSizes returns the available DPU sizes for Spark applications.
func (*InMemoryBackend) ListCalculationExecutions ¶
func (b *InMemoryBackend) ListCalculationExecutions(sessionID, stateFilter string) ([]CalculationSummary, error)
ListCalculationExecutions lists calculations within a session.
func (*InMemoryBackend) ListCapacityReservations ¶
func (b *InMemoryBackend) ListCapacityReservations() ([]CapacityReservation, error)
ListCapacityReservations returns all capacity reservations.
func (*InMemoryBackend) ListDataCatalogs ¶
func (b *InMemoryBackend) ListDataCatalogs( nextToken string, maxResults int, ) ([]*DataCatalogSummary, string, error)
ListDataCatalogs returns summaries of all data catalogs with optional NextToken/MaxResults pagination.
func (*InMemoryBackend) ListDatabases ¶
func (b *InMemoryBackend) ListDatabases(catalog string) ([]Database, error)
ListDatabases returns all databases for a catalog.
func (*InMemoryBackend) ListEngineVersions ¶
func (b *InMemoryBackend) ListEngineVersions() []EngineVersionDescriptor
ListEngineVersions returns the engines available to a workgroup.
func (*InMemoryBackend) ListExecutors ¶
func (b *InMemoryBackend) ListExecutors(sessionID, stateFilter string) ([]Executor, error)
ListExecutors returns executors associated with a session.
func (*InMemoryBackend) ListNamedQueries ¶
func (b *InMemoryBackend) ListNamedQueries( workGroup, nextToken string, maxResults int, ) ([]string, string, error)
ListNamedQueries returns named query IDs, optionally filtered by workgroup, with pagination.
func (*InMemoryBackend) ListNotebookMetadata ¶
func (b *InMemoryBackend) ListNotebookMetadata(workGroup, namePrefix string) ([]NotebookMetadata, error)
ListNotebookMetadata lists all notebooks (optionally filtered by workgroup and name).
func (*InMemoryBackend) ListNotebookSessions ¶
func (b *InMemoryBackend) ListNotebookSessions(notebookID string) ([]NotebookSessionSummary, error)
ListNotebookSessions returns sessions associated with a notebook. Real types.NotebookSessionSummary is CreationTime+SessionId only -- a distinct, narrower shape from types.SessionSummary (ListSessions), see NotebookSessionSummary's doc comment. CreationTime is sourced from the session's own Status.StartDateTime (its start IS its creation -- sessions have no separate pending-then-started state).
func (*InMemoryBackend) ListPreparedStatements ¶
func (b *InMemoryBackend) ListPreparedStatements( workGroup, nextToken string, maxResults int, ) ([]PreparedStatementSummary, string, error)
ListPreparedStatements returns summary views of prepared statements in a workgroup, sorted by name, with optional NextToken/MaxResults pagination.
func (*InMemoryBackend) ListQueryExecutions ¶
func (b *InMemoryBackend) ListQueryExecutions(workGroup string) ([]string, error)
ListQueryExecutions returns query execution IDs, optionally filtered by workgroup.
func (*InMemoryBackend) ListSessions ¶
func (b *InMemoryBackend) ListSessions(workGroup, stateFilter string) ([]SessionSummary, error)
ListSessions returns sessions for a workgroup, optionally filtered by state.
func (*InMemoryBackend) ListTableMetadata ¶
func (b *InMemoryBackend) ListTableMetadata(catalog, database, expr string) ([]TableMetadata, error)
ListTableMetadata returns all tables for a database, optionally filtered by a regex matched against table names (real Expression semantics — not a substring/prefix match).
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource( resourceARN, nextToken string, maxResults int, ) ([]Tag, string, error)
ListTagsForResource returns a page of tags for a resource identified by ARN, honoring AWS's MaxResults/NextToken pagination inputs. AWS returns InvalidRequestException when the ARN does not resolve to an existing taggable resource.
func (*InMemoryBackend) ListWorkGroups ¶
func (b *InMemoryBackend) ListWorkGroups( nextToken string, maxResults int, ) ([]*WorkGroupSummary, string, error)
ListWorkGroups returns summaries of all workgroups with optional NextToken/MaxResults pagination.
func (*InMemoryBackend) PutCapacityAssignmentConfiguration ¶
func (b *InMemoryBackend) PutCapacityAssignmentConfiguration( name string, assignments []CapacityAssignment, ) error
PutCapacityAssignmentConfiguration sets the assignment configuration on a reservation.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) SetClock ¶
func (b *InMemoryBackend) SetClock(now func() time.Time)
SetClock overrides the clock used for NOW in partition projection.
func (*InMemoryBackend) SetEngineLimits ¶
func (b *InMemoryBackend) SetEngineLimits(l EngineLimits)
SetEngineLimits overrides the SQL engine's resource caps and query timeout.
func (*InMemoryBackend) SetGlueMetadataSource ¶
func (b *InMemoryBackend) SetGlueMetadataSource(src GlueMetadataSource)
SetGlueMetadataSource wires a GLUE-type DataCatalog's database/table reads to real Glue state instead of Athena's internal simulation.
func (*InMemoryBackend) SetS3Backend ¶
func (b *InMemoryBackend) SetS3Backend(s3 S3Storer)
SetS3Backend wires S3 so a succeeded query execution's result actually writes an object to ResultConfiguration.OutputLocation, instead of only storing/echoing the configuration.
func (*InMemoryBackend) SetS3TablesSource ¶
func (b *InMemoryBackend) SetS3TablesSource(src S3TablesSource)
SetS3TablesSource wires the S3 Tables federated catalog.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartCalculationExecution ¶
func (b *InMemoryBackend) StartCalculationExecution( sessionID, description, codeBlock string, ) (string, string, error)
StartCalculationExecution starts a Spark calculation in the given session.
func (*InMemoryBackend) StartQueryExecution ¶
func (b *InMemoryBackend) StartQueryExecution( query, workGroup string, ctx QueryExecutionContext, rc ResultConfiguration, execParams []string, reuseCfg *ResultReuseConfiguration, ) (string, error)
StartQueryExecution records a new query execution and returns its ID.
func (*InMemoryBackend) StartSession ¶
func (b *InMemoryBackend) StartSession(workGroup, description, notebookVersion string, engineCfg EngineConfiguration, sessionCfg SessionConfiguration, monitoringCfg MonitoringConfiguration, notebookID string, ) (string, string, error)
StartSession creates a new session in the specified workgroup.
func (*InMemoryBackend) StopCalculationExecution ¶
func (b *InMemoryBackend) StopCalculationExecution(id string) (string, error)
StopCalculationExecution cancels a running calculation. Per AWS's documented behavior, "A StopCalculationExecution call on a calculation that is already in a terminal state (for example, STOPPED, FAILED, or COMPLETED) succeeds but has no effect." (aws-sdk-go-v2/service/athena@v1.60.4 api_op_StopCalculationExecution.go).
func (*InMemoryBackend) StopQueryExecution ¶
func (b *InMemoryBackend) StopQueryExecution(id string) error
StopQueryExecution marks a query execution as cancelled.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds tags to a resource identified by ARN. AWS returns InvalidRequestException when the ARN does not resolve to an existing taggable resource.
func (*InMemoryBackend) TagSession ¶
func (b *InMemoryBackend) TagSession(sessionID string, copyWorkGroupTags bool, tags map[string]string) error
TagSession tags a new session with tags, plus the workgroup's tags when copyWorkGroupTags is set.
func (*InMemoryBackend) TaggedResources ¶ added in v1.2.0
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources lists every tag-store ARN that carries at least one tag.
func (*InMemoryBackend) TerminateSession ¶
func (b *InMemoryBackend) TerminateSession(id string) (string, error)
TerminateSession terminates an existing session.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, keys []string) error
UntagResource removes tags from a resource identified by ARN. AWS returns InvalidRequestException when the ARN does not resolve to an existing taggable resource.
func (*InMemoryBackend) UpdateCapacityReservation ¶
func (b *InMemoryBackend) UpdateCapacityReservation(name string, targetDPUs int32) error
UpdateCapacityReservation changes the target DPUs of a capacity reservation.
func (*InMemoryBackend) UpdateDataCatalog ¶
func (b *InMemoryBackend) UpdateDataCatalog( name, catalogType, description string, params map[string]string, ) error
UpdateDataCatalog updates an existing data catalog.
func (*InMemoryBackend) UpdateNamedQuery ¶
func (b *InMemoryBackend) UpdateNamedQuery(id, name, description, queryString string) error
UpdateNamedQuery updates an existing named query's name, description, or query string.
func (*InMemoryBackend) UpdateNotebook ¶
func (b *InMemoryBackend) UpdateNotebook(notebookID, payload, notebookType, sessionID string) error
UpdateNotebook replaces the payload of an existing notebook.
func (*InMemoryBackend) UpdateNotebookMetadata ¶
func (b *InMemoryBackend) UpdateNotebookMetadata(notebookID, newName string) error
UpdateNotebookMetadata renames a notebook.
func (*InMemoryBackend) UpdatePreparedStatement ¶
func (b *InMemoryBackend) UpdatePreparedStatement(name, workGroup, queryStatement, description string) error
UpdatePreparedStatement updates an existing prepared statement.
func (*InMemoryBackend) UpdateWorkGroup ¶
func (b *InMemoryBackend) UpdateWorkGroup( name, description, state string, cfg *WorkGroupConfigurationUpdates, ) error
UpdateWorkGroup updates an existing workgroup.
UpdateWorkGroupInput.ConfigurationUpdates is types.WorkGroupConfigurationUpdates, a partial-update shape -- a real client only ever sends the fields it's changing. Merging via WorkGroupConfigurationUpdates.MergeInto (rather than wholesale-replacing wg.Configuration) is what preserves every field the request didn't mention (gopherstack-1vv2: previously any single-field update silently erased the rest of the workgroup's configuration).
type Janitor ¶
type Janitor struct {
Backend *InMemoryBackend
Interval time.Duration
ExecutionTTL time.Duration
// TaskTimeout bounds each individual janitor task. When non-zero, each task
// runs with a child context that expires after this duration, preventing a
// stalled operation from blocking the janitor loop indefinitely.
TaskTimeout time.Duration
}
Janitor is the Athena background worker that evicts completed query executions, their cached result sets, and stale sessions/calculations after a configurable TTL to prevent unbounded growth of in-memory state.
func NewJanitor ¶
func NewJanitor(backend *InMemoryBackend, interval, executionTTL time.Duration) *Janitor
NewJanitor creates a new Athena Janitor for the given backend. Zero values for interval or executionTTL fall back to defaults.
type ManagedLoggingConfiguration ¶ added in v1.3.1
type ManagedLoggingConfiguration struct {
KmsKey string `json:"KmsKey,omitempty"`
Enabled bool `json:"Enabled,omitempty"`
}
ManagedLoggingConfiguration controls Athena-managed log persistence for a session.
type ManagedQueryResultsConfiguration ¶
type ManagedQueryResultsConfiguration struct {
EncryptionConfiguration *ManagedResultsEncryption `json:"EncryptionConfiguration,omitempty"`
Enabled bool `json:"Enabled"`
}
ManagedQueryResultsConfiguration mirrors types.ManagedQueryResultsConfiguration.
type ManagedResultsEncryption ¶
type ManagedResultsEncryption struct {
KmsKey string `json:"KmsKey,omitempty"`
}
ManagedResultsEncryption mirrors types.ManagedQueryResultsEncryptionConfiguration.
type ManagedResultsUpdates ¶
type ManagedResultsUpdates struct {
Enabled *bool `json:"Enabled,omitempty"`
EncryptionConfiguration *ManagedResultsEncryption `json:"EncryptionConfiguration,omitempty"`
RemoveEncryptionConfiguration *bool `json:"RemoveEncryptionConfiguration,omitempty"`
}
ManagedResultsUpdates mirrors types.ManagedQueryResultsConfigurationUpdates.
type MonitoringConfiguration ¶ added in v1.3.1
type MonitoringConfiguration struct {
CloudWatchLoggingConfiguration CloudWatchLoggingConfiguration `json:"CloudWatchLoggingConfiguration,omitzero"`
ManagedLoggingConfiguration ManagedLoggingConfiguration `json:"ManagedLoggingConfiguration,omitzero"`
S3LoggingConfiguration S3LoggingConfiguration `json:"S3LoggingConfiguration,omitzero"`
}
MonitoringConfiguration is the log-delivery configuration for a session.
type NamedQuery ¶
type NamedQuery struct {
NamedQueryID string `json:"NamedQueryId"`
Name string `json:"Name"`
Description string `json:"Description,omitempty"`
Database string `json:"Database"`
QueryString string `json:"QueryString"`
WorkGroup string `json:"WorkGroup,omitempty"`
}
NamedQuery represents a saved Athena query.
type Notebook ¶
type Notebook struct {
NotebookID string `json:"NotebookId"`
Name string `json:"Name"`
WorkGroup string `json:"WorkGroup"`
Type string `json:"Type"`
Content string `json:"Content"`
CreationTime float64 `json:"CreationTime,omitempty"`
LastModifiedTime float64 `json:"LastModifiedTime,omitempty"`
}
Notebook represents an Athena notebook with its content.
type NotebookMetadata ¶
type NotebookMetadata struct {
NotebookID string `json:"NotebookId"`
Name string `json:"Name"`
WorkGroup string `json:"WorkGroup"`
Type string `json:"Type"`
CreationTime float64 `json:"CreationTime,omitempty"`
LastModifiedTime float64 `json:"LastModifiedTime,omitempty"`
}
NotebookMetadata holds metadata for an Athena notebook.
type NotebookSessionSummary ¶
type NotebookSessionSummary struct {
SessionID string `json:"SessionId"`
CreationTime float64 `json:"CreationTime,omitempty"`
}
NotebookSessionSummary is the list view of a session returned by ListNotebookSessions, field-diffed against types.NotebookSessionSummary (athena@v1.60.4) -- CreationTime and SessionId only. It is a distinct, narrower real shape from SessionSummary (ListSessions/StartSession): previously ListNotebookSessions marshaled SessionSummary directly, leaking Description/EngineVersion/NotebookVersion/Status onto the wire.
type PreparedStatement ¶
type PreparedStatement struct {
StatementName string `json:"StatementName"`
WorkGroupName string `json:"WorkGroupName"`
QueryStatement string `json:"QueryStatement"`
Description string `json:"Description,omitempty"`
LastModifiedTime float64 `json:"LastModifiedTime,omitempty"`
}
PreparedStatement represents an Athena prepared statement.
type PreparedStatementSummary ¶
type PreparedStatementSummary struct {
StatementName string `json:"StatementName"`
LastModifiedTime float64 `json:"LastModifiedTime,omitempty"`
}
PreparedStatementSummary is a reduced view returned by ListPreparedStatements.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Athena service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Athena backend and handler.
type QueryExecution ¶
type QueryExecution struct {
ResultConfiguration ResultConfiguration `json:"ResultConfiguration,omitzero"`
QueryExecutionContext QueryExecutionContext `json:"QueryExecutionContext,omitzero"`
ResultReuseConfiguration *ResultReuseConfiguration `json:"ResultReuseConfiguration,omitempty"`
EngineVersion *EngineVersion `json:"EngineVersion,omitempty"`
ManagedQueryResultsConfiguration *ManagedQueryResultsConfiguration `json:"ManagedQueryResultsConfiguration,omitempty"`
QueryExecutionID string `json:"QueryExecutionId"`
Query string `json:"Query"`
WorkGroup string `json:"WorkGroup,omitempty"`
StatementType string `json:"StatementType,omitempty"`
ExecutionParameters []string `json:"ExecutionParameters,omitempty"`
Status QueryExecutionStatus `json:"Status"`
Statistics QueryExecutionStatistics `json:"Statistics,omitzero"`
}
QueryExecution represents an Athena query execution.
type QueryExecutionContext ¶
type QueryExecutionContext struct {
Database string `json:"Database,omitempty"`
Catalog string `json:"Catalog,omitempty"`
}
QueryExecutionContext holds the database and catalog for a query execution.
type QueryExecutionError ¶
type QueryExecutionError struct {
ErrorMessage string `json:"ErrorMessage,omitempty"`
ErrorCategory int32 `json:"ErrorCategory,omitempty"`
ErrorType int32 `json:"ErrorType,omitempty"`
Retryable bool `json:"Retryable,omitempty"`
}
QueryExecutionError describes why a query execution reached the FAILED state, mirroring the AthenaError shape AWS returns inside QueryExecutionStatus (the JSON field is still "AthenaError").
type QueryExecutionStatistics ¶
type QueryExecutionStatistics struct {
ResultReuseInformation *ResultReuseInformation `json:"ResultReuseInformation,omitempty"`
DataManifestLocation string `json:"DataManifestLocation,omitempty"`
DpuCount float64 `json:"DpuCount,omitempty"`
EngineExecutionTimeInMillis int64 `json:"EngineExecutionTimeInMillis,omitempty"`
DataScannedInBytes int64 `json:"DataScannedInBytes,omitempty"`
QueryPlanningTimeInMillis int64 `json:"QueryPlanningTimeInMillis,omitempty"`
QueryQueueTimeInMillis int64 `json:"QueryQueueTimeInMillis,omitempty"`
ServicePreProcessingTimeInMillis int64 `json:"ServicePreProcessingTimeInMillis,omitempty"`
ServiceProcessingTimeInMillis int64 `json:"ServiceProcessingTimeInMillis,omitempty"`
TotalExecutionTimeInMillis int64 `json:"TotalExecutionTimeInMillis,omitempty"`
}
QueryExecutionStatistics holds statistics for a query execution.
ReusedPreviousResult lives under ResultReuseInformation on the wire, not flat on Statistics -- real ResultReuseInformation{ReusedPreviousResult} (athena@v1.60.4 deserializers.go's awsAwsjson11_deserializeDocumentResultReuseInformation).
type QueryExecutionStatus ¶
type QueryExecutionStatus struct {
AthenaError *QueryExecutionError `json:"AthenaError,omitempty"`
State string `json:"State"`
StateChangeReason string `json:"StateChangeReason,omitempty"`
SubmissionDateTime float64 `json:"SubmissionDateTime,omitempty"`
CompletionDateTime float64 `json:"CompletionDateTime,omitempty"`
}
QueryExecutionStatus holds the status of a query execution.
type QueryRuntimeStatistics ¶
type QueryRuntimeStatistics struct {
OutputStage QueryStage `json:"OutputStage,omitzero"`
Timeline QueryRuntimeStatisticsTimeline `json:"Timeline,omitzero"`
Rows QueryRuntimeStatisticsRows `json:"Rows,omitzero"`
}
QueryRuntimeStatistics aggregates runtime stats for a query execution.
type QueryRuntimeStatisticsRows ¶
type QueryRuntimeStatisticsRows struct {
InputRows int64 `json:"InputRows,omitempty"`
InputBytes int64 `json:"InputBytes,omitempty"`
OutputRows int64 `json:"OutputRows,omitempty"`
OutputBytes int64 `json:"OutputBytes,omitempty"`
}
QueryRuntimeStatisticsRows is the rows portion.
type QueryRuntimeStatisticsTimeline ¶
type QueryRuntimeStatisticsTimeline struct {
QueryQueueTimeInMillis int64 `json:"QueryQueueTimeInMillis,omitempty"`
QueryPlanningTimeInMillis int64 `json:"QueryPlanningTimeInMillis,omitempty"`
EngineExecutionTimeInMillis int64 `json:"EngineExecutionTimeInMillis,omitempty"`
ServiceProcessingTimeInMillis int64 `json:"ServiceProcessingTimeInMillis,omitempty"`
TotalExecutionTimeInMillis int64 `json:"TotalExecutionTimeInMillis,omitempty"`
}
QueryRuntimeStatisticsTimeline is the timeline portion.
type QueryStage ¶
type QueryStage struct {
State string `json:"State,omitempty"`
StageID int64 `json:"StageId,omitempty"`
OutputBytes int64 `json:"OutputBytes,omitempty"`
OutputRows int64 `json:"OutputRows,omitempty"`
InputBytes int64 `json:"InputBytes,omitempty"`
InputRows int64 `json:"InputRows,omitempty"`
ExecutionTime int64 `json:"ExecutionTime,omitempty"`
}
QueryStage is a single stage in the runtime statistics tree.
type ResultConfiguration ¶
type ResultConfiguration struct {
// ACLConfiguration is tagged "AclConfiguration" (not "ACLConfiguration") to
// match the real Athena wire shape: aws-sdk-go-v2's generated deserializer
// switches on the exact-case JSON key "AclConfiguration", so a mismatched
// tag here would make the SDK silently drop the field.
ACLConfiguration *ACLConfiguration `json:"AclConfiguration,omitempty"`
EncryptionConfiguration EncryptionConfiguration `json:"EncryptionConfiguration,omitzero"`
ExpectedBucketOwner string `json:"ExpectedBucketOwner,omitempty"`
OutputLocation string `json:"OutputLocation,omitempty"`
}
ResultConfiguration holds the configuration for where query results are stored.
type ResultReuseByAgeConfiguration ¶
type ResultReuseByAgeConfiguration struct {
Enabled bool `json:"Enabled"`
MaxAgeInMinutes int32 `json:"MaxAgeInMinutes,omitempty"`
}
ResultReuseByAgeConfiguration controls result reuse by result age.
type ResultReuseConfiguration ¶
type ResultReuseConfiguration struct {
ResultReuseByAgeConfiguration *ResultReuseByAgeConfiguration `json:"ResultReuseByAgeConfiguration,omitempty"`
}
ResultReuseConfiguration controls whether previous query results can be reused.
type ResultReuseInformation ¶ added in v1.3.1
type ResultReuseInformation struct {
ReusedPreviousResult bool `json:"ReusedPreviousResult"`
}
ResultReuseInformation reports whether a query execution reused a previous result, nested under QueryExecutionStatistics on the wire.
type S3AccessGrantsConfig ¶
type S3AccessGrantsConfig struct {
EnableS3AccessGrants *bool `json:"EnableS3AccessGrants,omitempty"`
CreateUserLevelPrefix *bool `json:"CreateUserLevelPrefix,omitempty"`
AuthenticationType string `json:"AuthenticationType,omitempty"`
}
S3AccessGrantsConfig mirrors types.QueryResultsS3AccessGrantsConfiguration.
type S3Deleter ¶
type S3Deleter interface {
DeleteObject(ctx context.Context, input *sdk_s3.DeleteObjectInput) (*sdk_s3.DeleteObjectOutput, error)
}
S3Deleter is the optional delete side of the wired S3 backend, used by VACUUM.
type S3Getter ¶
type S3Getter interface {
GetObject(ctx context.Context, input *sdk_s3.GetObjectInput) (*sdk_s3.GetObjectOutput, error)
}
S3Getter is the optional read side of the wired S3 backend, used to load ImportNotebook.NotebookS3LocationUri.
type S3Lister ¶
type S3Lister interface {
ListObjectsV2(ctx context.Context, input *sdk_s3.ListObjectsV2Input) (*sdk_s3.ListObjectsV2Output, error)
}
S3Lister is the listing side of the wired S3 backend.
type S3LoggingConfiguration ¶ added in v1.3.1
type S3LoggingConfiguration struct {
KmsKey string `json:"KmsKey,omitempty"`
LogLocation string `json:"LogLocation,omitempty"`
Enabled bool `json:"Enabled,omitempty"`
}
S3LoggingConfiguration controls delivery of session logs to Amazon S3.
type S3Storer ¶
type S3Storer interface {
PutObject(ctx context.Context, input *sdk_s3.PutObjectInput) (*sdk_s3.PutObjectOutput, error)
}
S3Storer is the subset of S3 operations Athena needs to write a succeeded query execution's result object to ResultConfiguration.OutputLocation, wired via SetS3Backend. When unset, results are stored/echoed but no S3 object is written.
type S3TableInfo ¶
S3TableInfo is an S3 Tables table as the SQL engine sees it.
type S3TablesSource ¶
type S3TablesSource interface {
GetTableInfo(region, tableBucket, namespace, table string) (*S3TableInfo, error)
CommitMetadataLocation(region, tableBucket, namespace, table, expected, next string) error
// CreateTable allocates an empty Iceberg table (no metadata.json yet) and returns its warehouse location.
// Errors wrap ErrCatalogEntityExists or ErrCatalogEntityNotFound where they apply.
CreateTable(region, tableBucket, namespace, table string) (*S3TableInfo, error)
DeleteTable(region, tableBucket, namespace, table string) error
ListNamespaces(region, tableBucket string) ([]string, error)
ListTables(region, tableBucket, namespace string) ([]string, error)
}
S3TablesSource resolves tables of the federated s3tablescatalog/<table-bucket> catalog (database = namespace), wired via SetS3TablesSource.
type SQLResultPage ¶
SQLResultPage is a paginated slice of a sqlResult.
type Session ¶
type Session struct {
EngineConfiguration EngineConfiguration `json:"EngineConfiguration,omitzero"`
SessionConfiguration SessionConfiguration `json:"SessionConfiguration,omitzero"`
MonitoringConfiguration MonitoringConfiguration `json:"MonitoringConfiguration,omitzero"`
SessionID string `json:"SessionId"`
Description string `json:"Description,omitempty"`
WorkGroup string `json:"WorkGroup"`
NotebookVersion string `json:"NotebookVersion,omitempty"`
NotebookID string `json:"NotebookId,omitempty"`
Status SessionStatus `json:"Status"`
Statistics SessionStatistics `json:"Statistics,omitzero"`
}
Session represents an interactive notebook session.
type SessionConfiguration ¶
type SessionConfiguration struct {
EncryptionConfiguration EncryptionConfiguration `json:"EncryptionConfiguration,omitzero"`
WorkingDirectory string `json:"WorkingDirectory,omitempty"`
ExecutionRole string `json:"ExecutionRole,omitempty"`
IdleTimeoutSeconds int64 `json:"IdleTimeoutSeconds,omitempty"`
}
SessionConfiguration is the configuration for a session.
type SessionStatistics ¶
type SessionStatistics struct {
DpuExecutionInMillis int64 `json:"DpuExecutionInMillis,omitempty"`
}
SessionStatistics holds session-level statistics.
type SessionStatus ¶
type SessionStatus struct {
StateChangeReason string `json:"StateChangeReason,omitempty"`
State string `json:"State"`
StartDateTime float64 `json:"StartDateTime,omitempty"`
LastModifiedDateTime float64 `json:"LastModifiedDateTime,omitempty"`
EndDateTime float64 `json:"EndDateTime,omitempty"`
IdleSinceDateTime float64 `json:"IdleSinceDateTime,omitempty"`
}
SessionStatus tracks the lifecycle of a session.
type SessionSummary ¶
type SessionSummary struct {
EngineVersion *EngineVersion `json:"EngineVersion,omitempty"`
SessionID string `json:"SessionId"`
Description string `json:"Description,omitempty"`
NotebookVersion string `json:"NotebookVersion,omitempty"`
Status SessionStatus `json:"Status,omitzero"`
}
SessionSummary is the list view of a session.
type Settings ¶
type Settings struct {
JanitorInterval time.Duration `json:"janitor_interval" env:"ATHENA_JANITOR_INTERVAL" default:"1m" help:"Janitor tick interval."` //nolint:lll // Kong struct tag makes this line long
ExecutionTTL time.Duration `` //nolint:lll // Kong struct tag makes this line long
/* 134-byte string literal not displayed */
}
Settings holds service-level configuration for the Athena backend. Fields are picked up by the Kong CLI parser when this struct is embedded in the root CLI command.
type StorageBackend ¶
type StorageBackend interface {
// WorkGroups
CreateWorkGroup(
name, description, state string,
cfg WorkGroupConfiguration,
tags map[string]string,
) error
GetWorkGroup(name string) (*WorkGroup, error)
ListWorkGroups(nextToken string, maxResults int) ([]*WorkGroupSummary, string, error)
UpdateWorkGroup(name, description, state string, cfg *WorkGroupConfigurationUpdates) error
DeleteWorkGroup(name string, recursiveDelete bool) error
// Named Queries
CreateNamedQuery(name, description, database, queryString, workGroup string) (string, error)
GetNamedQuery(id string) (*NamedQuery, error)
ListNamedQueries(workGroup, nextToken string, maxResults int) ([]string, string, error)
BatchGetNamedQuery(ids []string) ([]NamedQuery, []UnprocessedNamedQueryID)
DeleteNamedQuery(id string) error
// Data Catalogs
CreateDataCatalog(
name, catalogType, description string,
params, tags map[string]string,
) (*DataCatalog, error)
GetDataCatalog(name string) (*DataCatalog, error)
ListDataCatalogs(nextToken string, maxResults int) ([]*DataCatalogSummary, string, error)
UpdateDataCatalog(
name, catalogType, description string,
params map[string]string,
) error
DeleteDataCatalog(name string, deleteCatalogOnly bool) (*DataCatalog, error)
// Query Executions
StartQueryExecution(
query, workGroup string,
ctx QueryExecutionContext,
rc ResultConfiguration,
execParams []string,
reuseCfg *ResultReuseConfiguration,
) (string, error)
GetQueryExecution(id string) (*QueryExecution, error)
GetQueryResults(id, nextToken string, maxResults int) (*SQLResultPage, error)
ListQueryExecutions(workGroup string) ([]string, error)
StopQueryExecution(id string) error
BatchGetQueryExecution(ids []string) ([]QueryExecution, []UnprocessedQueryExecutionID)
// Tags
TagResource(arn string, tags map[string]string) error
UntagResource(arn string, keys []string) error
ListTagsForResource(arn, nextToken string, maxResults int) ([]Tag, string, error)
// Prepared Statements
BatchGetPreparedStatement(
workGroup string,
names []string,
) ([]PreparedStatement, []UnprocessedPreparedStatementName)
CreatePreparedStatement(name, description, workGroup, queryStatement string) error
DeletePreparedStatement(name, workGroup string) error
GetPreparedStatement(name, workGroup string) (*PreparedStatement, error)
ListPreparedStatements(
workGroup, nextToken string,
maxResults int,
) ([]PreparedStatementSummary, string, error)
// Capacity Reservations
CancelCapacityReservation(name string) error
CreateCapacityReservation(name string, targetDPUs int32, tags map[string]string) error
DeleteCapacityReservation(name string) error
// Notebooks
CreateNotebook(workGroup, name string) (string, error)
CreatePresignedNotebookURL(sessionID string) (url, authToken string, authTokenExpiration float64, err error)
DeleteNotebook(notebookID string) error
ExportNotebook(notebookID string) (NotebookMetadata, string, error)
GetNotebookMetadata(notebookID string) (*NotebookMetadata, error)
ListNotebookMetadata(workGroup, namePrefix string) ([]NotebookMetadata, error)
ImportNotebook(workGroup, name, payload, notebookType string) (string, error)
UpdateNotebook(notebookID, payload, notebookType, sessionID string) error
UpdateNotebookMetadata(notebookID, newName string) error
// Sessions
StartSession(
workGroup, description, notebookVersion string,
engineCfg EngineConfiguration,
sessionCfg SessionConfiguration,
monitoringCfg MonitoringConfiguration,
notebookID string,
) (string, string, error)
GetSession(id string) (*Session, error)
TagSession(sessionID string, copyWorkGroupTags bool, tags map[string]string) error
GetSessionStatus(id string) (SessionStatus, error)
GetSessionEndpoint(id string) (url, authToken string, authTokenExpiration float64, err error)
TerminateSession(id string) (string, error)
ListSessions(workGroup, stateFilter string) ([]SessionSummary, error)
ListNotebookSessions(notebookID string) ([]NotebookSessionSummary, error)
// Calculations
StartCalculationExecution(sessionID, description, codeBlock string) (string, string, error)
GetCalculationExecution(id string) (*CalculationExecution, error)
GetCalculationExecutionStatus(id string) (CalculationStatus, CalculationStatistics, error)
GetCalculationExecutionCode(id string) (string, error)
StopCalculationExecution(id string) (string, error)
ListCalculationExecutions(sessionID, stateFilter string) ([]CalculationSummary, error)
// Capacity reservations (extended)
GetCapacityReservation(name string) (*CapacityReservation, error)
ListCapacityReservations() ([]CapacityReservation, error)
UpdateCapacityReservation(name string, targetDPUs int32) error
PutCapacityAssignmentConfiguration(name string, assignments []CapacityAssignment) error
GetCapacityAssignmentConfiguration(name string) (*CapacityAssignmentConfiguration, error)
// Database / table metadata
GetDatabase(catalog, name string) (*Database, error)
ListDatabases(catalog string) ([]Database, error)
GetTableMetadata(catalog, database, table string) (*TableMetadata, error)
ListTableMetadata(catalog, database, expr string) ([]TableMetadata, error)
// Misc updates / runtime stats
UpdateNamedQuery(id, name, description, queryString string) error
UpdatePreparedStatement(name, workGroup, queryStatement, description string) error
GetQueryRuntimeStatistics(id string) (*QueryRuntimeStatistics, error)
GetResourceDashboard(resourceARN string) (string, error)
// Engine version / executor / DPU listings
ListEngineVersions() []EngineVersionDescriptor
ListApplicationDPUSizes() []ApplicationDPUSizes
ListExecutors(sessionID, stateFilter string) ([]Executor, error)
}
StorageBackend is the interface for the Athena in-memory store.
type TableMetadata ¶
type TableMetadata struct {
Parameters map[string]string `json:"Parameters,omitempty"`
Name string `json:"Name"`
TableType string `json:"TableType,omitempty"`
// Catalog and Database identify which data catalog and database this
// table belongs to. Together with Name they form the composite key
// store.Table's keyFn derives (see tableMetadataKeyFn in
// store_setup.go); Database alone is the tablesByDatabase secondary
// index's group key. Tagged json:"-" for the same reason as
// Database.Catalog above.
Catalog string `json:"-"`
Database string `json:"-"`
Columns []Column `json:"Columns,omitempty"`
PartitionKeys []Column `json:"PartitionKeys,omitempty"`
CreateTime float64 `json:"CreateTime,omitempty"`
LastAccessTime float64 `json:"LastAccessTime,omitempty"`
}
TableMetadata describes a table.
type TaggedEntry ¶ added in v1.2.0
TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingAthena).
type UnprocessedNamedQueryID ¶
type UnprocessedNamedQueryID struct {
NamedQueryID string `json:"NamedQueryId"`
ErrorCode string `json:"ErrorCode,omitempty"`
ErrorMessage string `json:"ErrorMessage,omitempty"`
}
UnprocessedNamedQueryID describes a named query that could not be retrieved.
type UnprocessedPreparedStatementName ¶
type UnprocessedPreparedStatementName struct {
StatementName string `json:"StatementName"`
ErrorMessage string `json:"ErrorMessage"`
}
UnprocessedPreparedStatementName describes a prepared statement that could not be retrieved.
type UnprocessedQueryExecutionID ¶
type UnprocessedQueryExecutionID struct {
QueryExecutionID string `json:"QueryExecutionId"`
ErrorCode string `json:"ErrorCode,omitempty"`
ErrorMessage string `json:"ErrorMessage,omitempty"`
}
UnprocessedQueryExecutionID describes a query execution that could not be retrieved.
type WorkGroup ¶
type WorkGroup struct {
Name string `json:"Name"`
Description string `json:"Description,omitempty"`
State string `json:"State"`
Configuration WorkGroupConfiguration `json:"Configuration,omitzero"`
CreationTime float64 `json:"CreationTime,omitempty"`
}
WorkGroup represents an Athena workgroup.
AWS's real GetWorkGroupOutput.WorkGroup carries no Tags field -- tags for a workgroup are managed exclusively through TagResource/UntagResource/ ListTagsForResource and stored in InMemoryBackend.resourceTags, never echoed back on the resource itself. A field here would be a gopherstack- invented addition to the wire shape.
type WorkGroupConfiguration ¶
type WorkGroupConfiguration struct {
// CustomerContentEncryptionConfiguration is split from the aligned block
// below to keep its line under the lll limit once combined with its tag.
CustomerContentEncryptionConfiguration *CustomerEncCfg `json:"CustomerContentEncryptionConfiguration,omitempty"`
IdentityCenter *IdentityCenterConfiguration `json:"IdentityCenterConfiguration,omitempty"`
ManagedResults *ManagedQueryResultsConfiguration `json:"ManagedQueryResultsConfiguration,omitempty"`
S3AccessGrants *S3AccessGrantsConfig `json:"QueryResultsS3AccessGrantsConfiguration,omitempty"`
EngineConfiguration *EngineConfiguration `json:"EngineConfiguration,omitempty"`
MonitoringConfiguration *MonitoringConfiguration `json:"MonitoringConfiguration,omitempty"`
ResultConfiguration ResultConfiguration `json:"ResultConfiguration,omitzero"`
EngineVersion EngineVersion `json:"EngineVersion,omitzero"`
AdditionalConfiguration string `json:"AdditionalConfiguration,omitempty"`
ExecutionRole string `json:"ExecutionRole,omitempty"`
BytesScannedCutoffPerQuery int64 `json:"BytesScannedCutoffPerQuery,omitempty"`
EnableMinEnc bool `json:"EnableMinimumEncryptionConfiguration,omitempty"`
EnforceWGCfg bool `json:"EnforceWorkGroupConfiguration,omitempty"`
PublishCWMetrics bool `json:"PublishCloudWatchMetricsEnabled,omitempty"`
RequesterPays bool `json:"RequesterPaysEnabled,omitempty"`
}
WorkGroupConfiguration holds configuration for a workgroup.
type WorkGroupConfigurationUpdates ¶ added in v1.5.0
type WorkGroupConfigurationUpdates struct {
// CustomerContentEncryptionConfiguration is split from the aligned block
// below to keep its line under the lll limit once combined with its tag.
CustomerContentEncryptionConfiguration *CustomerEncCfg `json:"CustomerContentEncryptionConfiguration,omitempty"`
ManagedResults *ManagedResultsUpdates `json:"ManagedQueryResultsConfigurationUpdates,omitempty"`
S3AccessGrants *S3AccessGrantsConfig `json:"QueryResultsS3AccessGrantsConfiguration,omitempty"`
ResultConfiguration *ResultConfiguration `json:"ResultConfigurationUpdates,omitempty"`
EngineVersion *EngineVersion `json:"EngineVersion,omitempty"`
EngineConfiguration *EngineConfiguration `json:"EngineConfiguration,omitempty"`
MonitoringConfiguration *MonitoringConfiguration `json:"MonitoringConfiguration,omitempty"`
AdditionalConfiguration *string `json:"AdditionalConfiguration,omitempty"`
ExecutionRole *string `json:"ExecutionRole,omitempty"`
BytesScannedCutoffPerQuery *int64 `json:"BytesScannedCutoffPerQuery,omitempty"`
EnableMinEnc *bool `json:"EnableMinimumEncryptionConfiguration,omitempty"`
EnforceWGCfg *bool `json:"EnforceWorkGroupConfiguration,omitempty"`
PublishCWMetrics *bool `json:"PublishCloudWatchMetricsEnabled,omitempty"`
RequesterPays *bool `json:"RequesterPaysEnabled,omitempty"`
RemoveBytesScannedCutoffPerQuery bool `json:"RemoveBytesScannedCutoffPerQuery,omitempty"`
RemoveCustomerContentEncryptionConfiguration bool `json:"RemoveCustomerContentEncryptionConfiguration,omitempty"`
}
WorkGroupConfigurationUpdates mirrors types.WorkGroupConfigurationUpdates, UpdateWorkGroupInput's ConfigurationUpdates shape. Unlike CreateWorkGroupInput's WorkGroupConfiguration, every scalar member is a pointer so an omitted field is distinguishable from an explicit zero/false/empty value -- required to merge an update into the stored configuration instead of wholesale-replacing it (gopherstack-1vv2: a real client's Update payload never repeats fields it isn't changing, so replacing the whole struct silently erased everything else, e.g. ResultConfiguration or EngineVersion, on every single-field update).
func (*WorkGroupConfigurationUpdates) MergeInto ¶ added in v1.5.0
func (u *WorkGroupConfigurationUpdates) MergeInto(cfg *WorkGroupConfiguration)
MergeInto applies only the members u actually carries onto cfg, leaving everything else untouched.
type WorkGroupSummary ¶
type WorkGroupSummary struct {
EngineVersion *EngineVersion `json:"EngineVersion,omitempty"`
Name string `json:"Name"`
Description string `json:"Description,omitempty"`
State string `json:"State"`
CreationTime float64 `json:"CreationTime,omitempty"`
}
WorkGroupSummary is a reduced view of a WorkGroup for list responses.
Source Files
¶
- calculations.go
- capacity_reservations.go
- data_catalogs.go
- databases.go
- databases_s3tables.go
- ddl.go
- ddl_parse.go
- engine_async.go
- engine_avro.go
- engine_avro_schema.go
- engine_bool.go
- engine_catalog.go
- engine_columnar.go
- engine_complex.go
- engine_consts.go
- engine_ddl.go
- engine_ddl_parse.go
- engine_delta.go
- engine_dml.go
- engine_dml_parse.go
- engine_embed.go
- engine_funcs.go
- engine_funcs_agg.go
- engine_funcs_agg_stat.go
- engine_funcs_array_ops.go
- engine_funcs_fold.go
- engine_funcs_json.go
- engine_funcs_registry.go
- engine_funcs_str.go
- engine_funcs_table.go
- engine_funcs_time.go
- engine_funcs_trino_math.go
- engine_funcs_trino_str.go
- engine_iceberg.go
- engine_iceberg_alter.go
- engine_iceberg_ctas.go
- engine_iceberg_ddl.go
- engine_iceberg_maint.go
- engine_iceberg_meta.go
- engine_iceberg_prune.go
- engine_iceberg_travel.go
- engine_iceberg_write.go
- engine_interval.go
- engine_interval_numeric.go
- engine_load.go
- engine_nested.go
- engine_optimize.go
- engine_orc.go
- engine_parquet.go
- engine_projection.go
- engine_projection_const.go
- engine_row.go
- engine_row_compare.go
- engine_run.go
- engine_s3tables.go
- engine_sql.go
- engine_sql_grouping.go
- engine_sql_grouping_order.go
- engine_sql_interval.go
- engine_sql_lambda.go
- engine_sql_orderby.go
- engine_sql_rowcompare.go
- engine_sql_subscript.go
- engine_temporal.go
- engine_tokens.go
- engine_unnest.go
- engine_unnest_vtab.go
- engine_write.go
- engine_write_format.go
- engine_write_parse.go
- errors.go
- handler.go
- handler_calculations.go
- handler_capacity_reservations.go
- handler_data_catalogs.go
- handler_databases.go
- handler_named_queries.go
- handler_notebooks.go
- handler_prepared_statements.go
- handler_query_executions.go
- handler_sessions.go
- handler_tags.go
- handler_work_groups.go
- idempotency.go
- interfaces.go
- janitor.go
- models.go
- named_queries.go
- notebook_s3.go
- notebooks.go
- pagination.go
- persistence.go
- prepared_exec.go
- prepared_statements.go
- provider.go
- query_engine_config.go
- query_executions.go
- region_handler.go
- result_object.go
- sessions.go
- settings.go
- sql.go
- sql_missing_table.go
- store.go
- store_setup.go
- tags.go
- work_groups.go