Documentation
¶
Index ¶
- Variables
- type ACLConfiguration
- type ApplicationDPUSizes
- type CalculationExecution
- type CalculationResult
- type CalculationStatistics
- type CalculationStatus
- type CalculationSummary
- type CapacityAllocation
- type CapacityAssignment
- type CapacityAssignmentConfiguration
- type CapacityReservation
- type Column
- type ConfigProvider
- type CustomerEncCfg
- type DataCatalog
- type DataCatalogSummary
- type Database
- type EncryptionConfiguration
- type EngineConfiguration
- type EngineVersion
- type EngineVersionDescriptor
- type Executor
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- 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) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- 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 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, connectionType 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) (*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) 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) 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) ([]SessionSummary, 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) 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) 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, connectionType 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 *WorkGroupConfiguration) error
- type Janitor
- type NamedQuery
- type Notebook
- type NotebookMetadata
- 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 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 WorkGroupSummary
Constants ¶
This section is empty.
Variables ¶
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 ErrUnknownOperation = errors.New("InvalidRequestException")
Functions ¶
This section is empty.
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"`
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"`
Statistics CalculationStatistics `json:"Statistics,omitzero"`
}
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 {
DpuExecutionInMillis int64 `json:"DpuExecutionInMillis,omitempty"`
Progress int64 `json:"Progress,omitempty"`
}
CalculationStatistics holds calculation runtime stats.
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 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"`
DefaultExecutorDpuSize int32 `json:"DefaultExecutorDpuSize,omitempty"`
MaxConcurrentDpus int32 `json:"MaxConcurrentDpus,omitempty"`
CoordinatorDpuSize int32 `json:"CoordinatorDpuSize,omitempty"`
}
EngineConfiguration is the engine configuration for a session.
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 float64 `json:"StartDateTime,omitempty"`
TerminationDateTime float64 `json:"TerminationDateTime,omitempty"`
ExecutorSize int64 `json:"ExecutorSize,omitempty"`
}
Executor describes a Spark executor.
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) 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) RouteMatcher ¶
RouteMatcher returns a function that matches incoming requests for Athena.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend.
func (*Handler) StartWorker ¶
StartWorker starts the background janitor if configured.
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.
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, connectionType 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) (*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.
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) error
DeleteWorkGroup removes a workgroup by name. The "primary" workgroup cannot be deleted.
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 the Live UI/Persistence UI dashboard URL for a resource (session) ARN, matching the real GetResourceDashboard response's single required "Url" field.
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) 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) ([]SessionSummary, error)
ListNotebookSessions returns sessions associated with a notebook.
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 name prefix.
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) 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, 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.
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) TaggedResources ¶ added in v1.2.0
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every Athena resource ARN that currently has at least one tag applied via TagResource, spanning every resource kind that shares the flat resourceTags map (workgroups, data catalogs, capacity reservations, notebooks).
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, connectionType 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 *WorkGroupConfiguration, ) error
UpdateWorkGroup updates an existing workgroup.
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 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 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"`
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 {
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"`
ReusedPreviousResult bool `json:"ReusedPreviousResult,omitempty"`
}
QueryExecutionStatistics holds statistics for a query execution.
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 Session ¶
type Session struct {
EngineConfiguration EngineConfiguration `json:"EngineConfiguration,omitzero"`
SessionConfiguration SessionConfiguration `json:"SessionConfiguration,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 {
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 *WorkGroupConfiguration) error
DeleteWorkGroup(name string) 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, connectionType 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, connectionType string,
params map[string]string,
) error
DeleteDataCatalog(name string) (*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,
notebookID string,
) (string, string, error)
GetSession(id string) (*Session, 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) ([]SessionSummary, 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 *CustomerEncCfg `json:"CustomerContentEncryptionConfiguration,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 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
- ddl.go
- ddl_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
- interfaces.go
- janitor.go
- models.go
- named_queries.go
- notebooks.go
- pagination.go
- persistence.go
- prepared_statements.go
- provider.go
- query_executions.go
- sessions.go
- settings.go
- sql.go
- store.go
- store_setup.go
- tags.go
- work_groups.go