1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package types 4 5import ( 6 "time" 7) 8 9// Contains metadata for a column in a table. 10type Column struct { 11 12 // The name of the column. 13 // 14 // This member is required. 15 Name *string 16 17 // Optional information about the column. 18 Comment *string 19 20 // The data type of the column. 21 Type *string 22} 23 24// Information about the columns in a query execution result. 25type ColumnInfo struct { 26 27 // The name of the column. 28 // 29 // This member is required. 30 Name *string 31 32 // The data type of the column. 33 // 34 // This member is required. 35 Type *string 36 37 // Indicates whether values in the column are case-sensitive. 38 CaseSensitive bool 39 40 // The catalog to which the query results belong. 41 CatalogName *string 42 43 // A column label. 44 Label *string 45 46 // Indicates the column's nullable status. 47 Nullable ColumnNullable 48 49 // For DECIMAL data types, specifies the total number of digits, up to 38. For 50 // performance reasons, we recommend up to 18 digits. 51 Precision int32 52 53 // For DECIMAL data types, specifies the total number of digits in the fractional 54 // part of the value. Defaults to 0. 55 Scale int32 56 57 // The schema name (database name) to which the query results belong. 58 SchemaName *string 59 60 // The table name for the query results. 61 TableName *string 62} 63 64// Contains metadata information for a database in a data catalog. 65type Database struct { 66 67 // The name of the database. 68 // 69 // This member is required. 70 Name *string 71 72 // An optional description of the database. 73 Description *string 74 75 // A set of custom key/value pairs. 76 Parameters map[string]string 77} 78 79// Contains information about a data catalog in an AWS account. 80type DataCatalog struct { 81 82 // The name of the data catalog. The catalog name must be unique for the AWS 83 // account and can use a maximum of 128 alphanumeric, underscore, at sign, or 84 // hyphen characters. 85 // 86 // This member is required. 87 Name *string 88 89 // The type of data catalog: LAMBDA for a federated catalog, GLUE for AWS Glue 90 // Catalog, or HIVE for an external hive metastore. 91 // 92 // This member is required. 93 Type DataCatalogType 94 95 // An optional description of the data catalog. 96 Description *string 97 98 // Specifies the Lambda function or functions to use for the data catalog. This is 99 // a mapping whose values depend on the catalog type. 100 // 101 // * For the HIVE data catalog 102 // type, use the following syntax. The metadata-function parameter is required. The 103 // sdk-version parameter is optional and defaults to the currently supported 104 // version. metadata-function=lambda_arn, sdk-version=version_number 105 // 106 // * For the 107 // LAMBDA data catalog type, use one of the following sets of required parameters, 108 // but not both. 109 // 110 // * If you have one Lambda function that processes metadata and 111 // another for reading the actual data, use the following syntax. Both parameters 112 // are required. metadata-function=lambda_arn, record-function=lambda_arn 113 // 114 // * If you 115 // have a composite Lambda function that processes both metadata and data, use the 116 // following syntax to specify your Lambda function. function=lambda_arn 117 // 118 // * The 119 // GLUE type has no parameters. 120 Parameters map[string]string 121} 122 123// The summary information for the data catalog, which includes its name and type. 124type DataCatalogSummary struct { 125 126 // The name of the data catalog. 127 CatalogName *string 128 129 // The data catalog type. 130 Type DataCatalogType 131} 132 133// A piece of data (a field in the table). 134type Datum struct { 135 136 // The value of the datum. 137 VarCharValue *string 138} 139 140// If query results are encrypted in Amazon S3, indicates the encryption option 141// used (for example, SSE-KMS or CSE-KMS) and key information. 142type EncryptionConfiguration struct { 143 144 // Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys 145 // (SSE-S3), server-side encryption with KMS-managed keys (SSE-KMS), or client-side 146 // encryption with KMS-managed keys (CSE-KMS) is used. If a query runs in a 147 // workgroup and the workgroup overrides client-side settings, then the workgroup's 148 // setting for encryption is used. It specifies whether query results must be 149 // encrypted, for all queries that run in this workgroup. 150 // 151 // This member is required. 152 EncryptionOption EncryptionOption 153 154 // For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID. 155 KmsKey *string 156} 157 158// A query, where QueryString is the list of SQL query statements that comprise the 159// query. 160type NamedQuery struct { 161 162 // The database to which the query belongs. 163 // 164 // This member is required. 165 Database *string 166 167 // The query name. 168 // 169 // This member is required. 170 Name *string 171 172 // The SQL query statements that comprise the query. 173 // 174 // This member is required. 175 QueryString *string 176 177 // The query description. 178 Description *string 179 180 // The unique identifier of the query. 181 NamedQueryId *string 182 183 // The name of the workgroup that contains the named query. 184 WorkGroup *string 185} 186 187// Information about a single instance of a query execution. 188type QueryExecution struct { 189 190 // The SQL query statements which the query execution ran. 191 Query *string 192 193 // The database in which the query execution occurred. 194 QueryExecutionContext *QueryExecutionContext 195 196 // The unique identifier for each query execution. 197 QueryExecutionId *string 198 199 // The location in Amazon S3 where query results were stored and the encryption 200 // option, if any, used for query results. These are known as "client-side 201 // settings". If workgroup settings override client-side settings, then the query 202 // uses the location for the query results and the encryption configuration that 203 // are specified for the workgroup. 204 ResultConfiguration *ResultConfiguration 205 206 // The type of query statement that was run. DDL indicates DDL query statements. 207 // DML indicates DML (Data Manipulation Language) query statements, such as CREATE 208 // TABLE AS SELECT. UTILITY indicates query statements other than DDL and DML, such 209 // as SHOW CREATE TABLE, or DESCRIBE . 210 StatementType StatementType 211 212 // Query execution statistics, such as the amount of data scanned, the amount of 213 // time that the query took to process, and the type of statement that was run. 214 Statistics *QueryExecutionStatistics 215 216 // The completion date, current state, submission time, and state change reason (if 217 // applicable) for the query execution. 218 Status *QueryExecutionStatus 219 220 // The name of the workgroup in which the query ran. 221 WorkGroup *string 222} 223 224// The database and data catalog context in which the query execution occurs. 225type QueryExecutionContext struct { 226 227 // The name of the data catalog used in the query execution. 228 Catalog *string 229 230 // The name of the database used in the query execution. 231 Database *string 232} 233 234// The amount of data scanned during the query execution and the amount of time 235// that it took to execute, and the type of statement that was run. 236type QueryExecutionStatistics struct { 237 238 // The location and file name of a data manifest file. The manifest file is saved 239 // to the Athena query results location in Amazon S3. The manifest file tracks 240 // files that the query wrote to Amazon S3. If the query fails, the manifest file 241 // also tracks files that the query intended to write. The manifest is useful for 242 // identifying orphaned files resulting from a failed query. For more information, 243 // see Working with Query Results, Output Files, and Query History 244 // (https://docs.aws.amazon.com/athena/latest/ug/querying.html) in the Amazon 245 // Athena User Guide. 246 DataManifestLocation *string 247 248 // The number of bytes in the data that was queried. 249 DataScannedInBytes *int64 250 251 // The number of milliseconds that the query took to execute. 252 EngineExecutionTimeInMillis *int64 253 254 // The number of milliseconds that Athena took to plan the query processing flow. 255 // This includes the time spent retrieving table partitions from the data source. 256 // Note that because the query engine performs the query planning, query planning 257 // time is a subset of engine processing time. 258 QueryPlanningTimeInMillis *int64 259 260 // The number of milliseconds that the query was in your query queue waiting for 261 // resources. Note that if transient errors occur, Athena might automatically add 262 // the query back to the queue. 263 QueryQueueTimeInMillis *int64 264 265 // The number of milliseconds that Athena took to finalize and publish the query 266 // results after the query engine finished running the query. 267 ServiceProcessingTimeInMillis *int64 268 269 // The number of milliseconds that Athena took to run the query. 270 TotalExecutionTimeInMillis *int64 271} 272 273// The completion date, current state, submission time, and state change reason (if 274// applicable) for the query execution. 275type QueryExecutionStatus struct { 276 277 // The date and time that the query completed. 278 CompletionDateTime *time.Time 279 280 // The state of query execution. QUEUED indicates that the query has been submitted 281 // to the service, and Athena will execute the query as soon as resources are 282 // available. RUNNING indicates that the query is in execution phase. SUCCEEDED 283 // indicates that the query completed without errors. FAILED indicates that the 284 // query experienced an error and did not complete processing. CANCELLED indicates 285 // that a user input interrupted query execution. Athena automatically retries your 286 // queries in cases of certain transient errors. As a result, you may see the query 287 // state transition from RUNNING or FAILED to QUEUED. 288 State QueryExecutionState 289 290 // Further detail about the status of the query. 291 StateChangeReason *string 292 293 // The date and time that the query was submitted. 294 SubmissionDateTime *time.Time 295} 296 297// The location in Amazon S3 where query results are stored and the encryption 298// option, if any, used for query results. These are known as "client-side 299// settings". If workgroup settings override client-side settings, then the query 300// uses the workgroup settings. 301type ResultConfiguration struct { 302 303 // If query results are encrypted in Amazon S3, indicates the encryption option 304 // used (for example, SSE-KMS or CSE-KMS) and key information. This is a 305 // client-side setting. If workgroup settings override client-side settings, then 306 // the query uses the encryption configuration that is specified for the workgroup, 307 // and also uses the location for storing query results specified in the workgroup. 308 // See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings 309 // Override Client-Side Settings 310 // (https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). 311 EncryptionConfiguration *EncryptionConfiguration 312 313 // The location in Amazon S3 where your query results are stored, such as 314 // s3://path/to/query/bucket/. To run the query, you must specify the query results 315 // location using one of the ways: either for individual queries using either this 316 // setting (client-side), or in the workgroup, using WorkGroupConfiguration. If 317 // none of them is set, Athena issues an error that no output location is provided. 318 // For more information, see Query Results 319 // (https://docs.aws.amazon.com/athena/latest/ug/querying.html). If workgroup 320 // settings override client-side settings, then the query uses the settings 321 // specified for the workgroup. See 322 // WorkGroupConfiguration$EnforceWorkGroupConfiguration. 323 OutputLocation *string 324} 325 326// The information about the updates in the query results, such as output location 327// and encryption configuration for the query results. 328type ResultConfigurationUpdates struct { 329 330 // The encryption configuration for the query results. 331 EncryptionConfiguration *EncryptionConfiguration 332 333 // The location in Amazon S3 where your query results are stored, such as 334 // s3://path/to/query/bucket/. For more information, see Query Results 335 // (https://docs.aws.amazon.com/athena/latest/ug/querying.html) If workgroup 336 // settings override client-side settings, then the query uses the location for the 337 // query results and the encryption configuration that are specified for the 338 // workgroup. The "workgroup settings override" is specified in 339 // EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See 340 // WorkGroupConfiguration$EnforceWorkGroupConfiguration. 341 OutputLocation *string 342 343 // If set to "true", indicates that the previously-specified encryption 344 // configuration (also known as the client-side setting) for queries in this 345 // workgroup should be ignored and set to null. If set to "false" or not set, and a 346 // value is present in the EncryptionConfiguration in ResultConfigurationUpdates 347 // (the client-side setting), the EncryptionConfiguration in the workgroup's 348 // ResultConfiguration will be updated with the new value. For more information, 349 // see Workgroup Settings Override Client-Side Settings 350 // (https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). 351 RemoveEncryptionConfiguration *bool 352 353 // If set to "true", indicates that the previously-specified query results location 354 // (also known as a client-side setting) for queries in this workgroup should be 355 // ignored and set to null. If set to "false" or not set, and a value is present in 356 // the OutputLocation in ResultConfigurationUpdates (the client-side setting), the 357 // OutputLocation in the workgroup's ResultConfiguration will be updated with the 358 // new value. For more information, see Workgroup Settings Override Client-Side 359 // Settings 360 // (https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). 361 RemoveOutputLocation *bool 362} 363 364// The metadata and rows that comprise a query result set. The metadata describes 365// the column structure and data types. To return a ResultSet object, use 366// GetQueryResults. 367type ResultSet struct { 368 369 // The metadata that describes the column structure and data types of a table of 370 // query results. 371 ResultSetMetadata *ResultSetMetadata 372 373 // The rows in the table. 374 Rows []Row 375} 376 377// The metadata that describes the column structure and data types of a table of 378// query results. To return a ResultSetMetadata object, use GetQueryResults. 379type ResultSetMetadata struct { 380 381 // Information about the columns returned in a query result metadata. 382 ColumnInfo []ColumnInfo 383} 384 385// The rows that comprise a query result table. 386type Row struct { 387 388 // The data that populates a row in a query result table. 389 Data []Datum 390} 391 392// Contains metadata for a table. 393type TableMetadata struct { 394 395 // The name of the table. 396 // 397 // This member is required. 398 Name *string 399 400 // A list of the columns in the table. 401 Columns []Column 402 403 // The time that the table was created. 404 CreateTime *time.Time 405 406 // The last time the table was accessed. 407 LastAccessTime *time.Time 408 409 // A set of custom key/value pairs for table properties. 410 Parameters map[string]string 411 412 // A list of the partition keys in the table. 413 PartitionKeys []Column 414 415 // The type of table. In Athena, only EXTERNAL_TABLE is supported. 416 TableType *string 417} 418 419// A label that you assign to a resource. In Athena, a resource can be a workgroup 420// or data catalog. Each tag consists of a key and an optional value, both of which 421// you define. For example, you can use tags to categorize Athena workgroups or 422// data catalogs by purpose, owner, or environment. Use a consistent set of tag 423// keys to make it easier to search and filter workgroups or data catalogs in your 424// account. For best practices, see Tagging Best Practices 425// (https://aws.amazon.com/answers/account-management/aws-tagging-strategies/). Tag 426// keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 427// to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable 428// in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are 429// case-sensitive. Tag keys must be unique per resource. If you specify more than 430// one tag, separate them by commas. 431type Tag struct { 432 433 // A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You 434 // can use letters and numbers representable in UTF-8, and the following 435 // characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per 436 // resource. 437 Key *string 438 439 // A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. 440 // You can use letters and numbers representable in UTF-8, and the following 441 // characters: + - = . _ : / @. Tag values are case-sensitive. 442 Value *string 443} 444 445// Information about a named query ID that could not be processed. 446type UnprocessedNamedQueryId struct { 447 448 // The error code returned when the processing request for the named query failed, 449 // if applicable. 450 ErrorCode *string 451 452 // The error message returned when the processing request for the named query 453 // failed, if applicable. 454 ErrorMessage *string 455 456 // The unique identifier of the named query. 457 NamedQueryId *string 458} 459 460// Describes a query execution that failed to process. 461type UnprocessedQueryExecutionId struct { 462 463 // The error code returned when the query execution failed to process, if 464 // applicable. 465 ErrorCode *string 466 467 // The error message returned when the query execution failed to process, if 468 // applicable. 469 ErrorMessage *string 470 471 // The unique identifier of the query execution. 472 QueryExecutionId *string 473} 474 475// A workgroup, which contains a name, description, creation time, state, and other 476// configuration, listed under WorkGroup$Configuration. Each workgroup enables you 477// to isolate queries for you or your group of users from other queries in the same 478// account, to configure the query results location and the encryption 479// configuration (known as workgroup settings), to enable sending query metrics to 480// Amazon CloudWatch, and to establish per-query data usage control limits for all 481// queries in a workgroup. The workgroup settings override is specified in 482// EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See 483// WorkGroupConfiguration$EnforceWorkGroupConfiguration. 484type WorkGroup struct { 485 486 // The workgroup name. 487 // 488 // This member is required. 489 Name *string 490 491 // The configuration of the workgroup, which includes the location in Amazon S3 492 // where query results are stored, the encryption configuration, if any, used for 493 // query results; whether the Amazon CloudWatch Metrics are enabled for the 494 // workgroup; whether workgroup settings override client-side settings; and the 495 // data usage limits for the amount of data scanned per query or per workgroup. The 496 // workgroup settings override is specified in EnforceWorkGroupConfiguration 497 // (true/false) in the WorkGroupConfiguration. See 498 // WorkGroupConfiguration$EnforceWorkGroupConfiguration. 499 Configuration *WorkGroupConfiguration 500 501 // The date and time the workgroup was created. 502 CreationTime *time.Time 503 504 // The workgroup description. 505 Description *string 506 507 // The state of the workgroup: ENABLED or DISABLED. 508 State WorkGroupState 509} 510 511// The configuration of the workgroup, which includes the location in Amazon S3 512// where query results are stored, the encryption option, if any, used for query 513// results, whether the Amazon CloudWatch Metrics are enabled for the workgroup and 514// whether workgroup settings override query settings, and the data usage limits 515// for the amount of data scanned per query or per workgroup. The workgroup 516// settings override is specified in EnforceWorkGroupConfiguration (true/false) in 517// the WorkGroupConfiguration. See 518// WorkGroupConfiguration$EnforceWorkGroupConfiguration. 519type WorkGroupConfiguration struct { 520 521 // The upper data usage limit (cutoff) for the amount of bytes a single query in a 522 // workgroup is allowed to scan. 523 BytesScannedCutoffPerQuery *int64 524 525 // If set to "true", the settings for the workgroup override client-side settings. 526 // If set to "false", client-side settings are used. For more information, see 527 // Workgroup Settings Override Client-Side Settings 528 // (https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). 529 EnforceWorkGroupConfiguration *bool 530 531 // Indicates that the Amazon CloudWatch metrics are enabled for the workgroup. 532 PublishCloudWatchMetricsEnabled *bool 533 534 // If set to true, allows members assigned to a workgroup to reference Amazon S3 535 // Requester Pays buckets in queries. If set to false, workgroup members cannot 536 // query data from Requester Pays buckets, and queries that retrieve data from 537 // Requester Pays buckets cause an error. The default is false. For more 538 // information about Requester Pays buckets, see Requester Pays Buckets 539 // (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) in 540 // the Amazon Simple Storage Service Developer Guide. 541 RequesterPaysEnabled *bool 542 543 // The configuration for the workgroup, which includes the location in Amazon S3 544 // where query results are stored and the encryption option, if any, used for query 545 // results. To run the query, you must specify the query results location using one 546 // of the ways: either in the workgroup using this setting, or for individual 547 // queries (client-side), using ResultConfiguration$OutputLocation. If none of them 548 // is set, Athena issues an error that no output location is provided. For more 549 // information, see Query Results 550 // (https://docs.aws.amazon.com/athena/latest/ug/querying.html). 551 ResultConfiguration *ResultConfiguration 552} 553 554// The configuration information that will be updated for this workgroup, which 555// includes the location in Amazon S3 where query results are stored, the 556// encryption option, if any, used for query results, whether the Amazon CloudWatch 557// Metrics are enabled for the workgroup, whether the workgroup settings override 558// the client-side settings, and the data usage limit for the amount of bytes 559// scanned per query, if it is specified. 560type WorkGroupConfigurationUpdates struct { 561 562 // The upper limit (cutoff) for the amount of bytes a single query in a workgroup 563 // is allowed to scan. 564 BytesScannedCutoffPerQuery *int64 565 566 // If set to "true", the settings for the workgroup override client-side settings. 567 // If set to "false" client-side settings are used. For more information, see 568 // Workgroup Settings Override Client-Side Settings 569 // (https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html). 570 EnforceWorkGroupConfiguration *bool 571 572 // Indicates whether this workgroup enables publishing metrics to Amazon 573 // CloudWatch. 574 PublishCloudWatchMetricsEnabled *bool 575 576 // Indicates that the data usage control limit per query is removed. 577 // WorkGroupConfiguration$BytesScannedCutoffPerQuery 578 RemoveBytesScannedCutoffPerQuery *bool 579 580 // If set to true, allows members assigned to a workgroup to specify Amazon S3 581 // Requester Pays buckets in queries. If set to false, workgroup members cannot 582 // query data from Requester Pays buckets, and queries that retrieve data from 583 // Requester Pays buckets cause an error. The default is false. For more 584 // information about Requester Pays buckets, see Requester Pays Buckets 585 // (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) in 586 // the Amazon Simple Storage Service Developer Guide. 587 RequesterPaysEnabled *bool 588 589 // The result configuration information about the queries in this workgroup that 590 // will be updated. Includes the updated results location and an updated option for 591 // encrypting query results. 592 ResultConfigurationUpdates *ResultConfigurationUpdates 593} 594 595// The summary information for the workgroup, which includes its name, state, 596// description, and the date and time it was created. 597type WorkGroupSummary struct { 598 599 // The workgroup creation date and time. 600 CreationTime *time.Time 601 602 // The workgroup description. 603 Description *string 604 605 // The name of the workgroup. 606 Name *string 607 608 // The state of the workgroup. 609 State WorkGroupState 610} 611