Skip to content

Commit 5372c46

Browse files
Add support for the managed query result in the workgroup APIs. The managed query result configuration enables users to store query results to Athena owned storage.
1 parent ceb62a1 commit 5372c46

22 files changed

+948
-6
lines changed

generator/ServiceModels/athena/athena-2017-05-18.api.json

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,8 @@
19151915
"members":{
19161916
"QueryExecutionId":{"shape":"QueryExecutionId"},
19171917
"NextToken":{"shape":"Token"},
1918-
"MaxResults":{"shape":"MaxQueryResults"}
1918+
"MaxResults":{"shape":"MaxQueryResults"},
1919+
"QueryResultType":{"shape":"QueryResultType"}
19191920
}
19201921
},
19211922
"GetQueryResultsOutput":{
@@ -2343,6 +2344,29 @@
23432344
}
23442345
},
23452346
"Long":{"type":"long"},
2347+
"ManagedQueryResultsConfiguration":{
2348+
"type":"structure",
2349+
"required":["Enabled"],
2350+
"members":{
2351+
"Enabled":{"shape":"Boolean"},
2352+
"EncryptionConfiguration":{"shape":"ManagedQueryResultsEncryptionConfiguration"}
2353+
}
2354+
},
2355+
"ManagedQueryResultsConfigurationUpdates":{
2356+
"type":"structure",
2357+
"members":{
2358+
"Enabled":{"shape":"BoxedBoolean"},
2359+
"EncryptionConfiguration":{"shape":"ManagedQueryResultsEncryptionConfiguration"},
2360+
"RemoveEncryptionConfiguration":{"shape":"BoxedBoolean"}
2361+
}
2362+
},
2363+
"ManagedQueryResultsEncryptionConfiguration":{
2364+
"type":"structure",
2365+
"required":["KmsKey"],
2366+
"members":{
2367+
"KmsKey":{"shape":"KmsKey"}
2368+
}
2369+
},
23462370
"MaxApplicationDPUSizesCount":{
23472371
"type":"integer",
23482372
"max":100,
@@ -2601,6 +2625,7 @@
26012625
"QueryExecutionId":{"shape":"QueryExecutionId"},
26022626
"Query":{"shape":"QueryString"},
26032627
"StatementType":{"shape":"StatementType"},
2628+
"ManagedQueryResultsConfiguration":{"shape":"ManagedQueryResultsConfiguration"},
26042629
"ResultConfiguration":{"shape":"ResultConfiguration"},
26052630
"ResultReuseConfiguration":{"shape":"ResultReuseConfiguration"},
26062631
"QueryExecutionContext":{"shape":"QueryExecutionContext"},
@@ -2670,6 +2695,13 @@
26702695
"AthenaError":{"shape":"AthenaError"}
26712696
}
26722697
},
2698+
"QueryResultType":{
2699+
"type":"string",
2700+
"enum":[
2701+
"DATA_MANIFEST",
2702+
"DATA_ROWS"
2703+
]
2704+
},
26732705
"QueryResultsS3AccessGrantsConfiguration":{
26742706
"type":"structure",
26752707
"required":[
@@ -3316,6 +3348,7 @@
33163348
"type":"structure",
33173349
"members":{
33183350
"ResultConfiguration":{"shape":"ResultConfiguration"},
3351+
"ManagedQueryResultsConfiguration":{"shape":"ManagedQueryResultsConfiguration"},
33193352
"EnforceWorkGroupConfiguration":{"shape":"BoxedBoolean"},
33203353
"PublishCloudWatchMetricsEnabled":{"shape":"BoxedBoolean"},
33213354
"BytesScannedCutoffPerQuery":{"shape":"BytesScannedCutoffValue"},
@@ -3334,6 +3367,7 @@
33343367
"members":{
33353368
"EnforceWorkGroupConfiguration":{"shape":"BoxedBoolean"},
33363369
"ResultConfigurationUpdates":{"shape":"ResultConfigurationUpdates"},
3370+
"ManagedQueryResultsConfigurationUpdates":{"shape":"ManagedQueryResultsConfigurationUpdates"},
33373371
"PublishCloudWatchMetricsEnabled":{"shape":"BoxedBoolean"},
33383372
"BytesScannedCutoffPerQuery":{"shape":"BytesScannedCutoffValue"},
33393373
"RemoveBytesScannedCutoffPerQuery":{"shape":"BoxedBoolean"},

generator/ServiceModels/athena/athena-2017-05-18.docs.json

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
"AthenaError$Retryable": "<p>True if the query might succeed if resubmitted.</p>",
168168
"ColumnInfo$CaseSensitive": "<p>Indicates whether values in the column are case-sensitive.</p>",
169169
"DeleteDataCatalogInput$DeleteCatalogOnly": "<p>Deletes the Athena Data Catalog. You can only use this with the <code>FEDERATED</code> catalogs. You usually perform this before registering the connector with Glue Data Catalog. After deletion, you will have to manage the Glue Connection and Lambda function. </p>",
170+
"ManagedQueryResultsConfiguration$Enabled": "<p>If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under <code>ResultConfiguration$OutputLocation</code>. The default is false. A workgroup cannot have the <code>ResultConfiguration$OutputLocation</code> parameter when you set this field to true. </p>",
170171
"ResultReuseByAgeConfiguration$Enabled": "<p>True if previous query results can be reused when the query is run; otherwise, false. The default is false.</p>",
171172
"ResultReuseInformation$ReusedPreviousResult": "<p>True if a previous query result was reused; false if the result was generated from a new run of the query.</p>"
172173
}
@@ -176,6 +177,8 @@
176177
"refs": {
177178
"DeleteWorkGroupInput$RecursiveDeleteOption": "<p>The option to delete the workgroup and its contents even if the workgroup contains any named queries, query executions, or notebooks.</p>",
178179
"IdentityCenterConfiguration$EnableIdentityCenter": "<p>Specifies whether the workgroup is IAM Identity Center supported.</p>",
180+
"ManagedQueryResultsConfigurationUpdates$Enabled": "<p>If set to true, specifies that Athena manages query results in Athena owned storage.</p>",
181+
"ManagedQueryResultsConfigurationUpdates$RemoveEncryptionConfiguration": "<p>If set to true, it removes workgroup from Athena owned storage. The existing query results are cleaned up after 24hrs. You must provide query results in location specified under <code>ResultConfiguration$OutputLocation</code>.</p>",
179182
"QueryResultsS3AccessGrantsConfiguration$EnableS3AccessGrants": "<p>Specifies whether Amazon S3 access grants are enabled for query results.</p>",
180183
"QueryResultsS3AccessGrantsConfiguration$CreateUserLevelPrefix": "<p>When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location.</p>",
181184
"ResultConfigurationUpdates$RemoveOutputLocation": "<p>If set to \"true\", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to \"false\" or not set, and a value is present in the <code>OutputLocation</code> in <code>ResultConfigurationUpdates</code> (the client-side setting), the <code>OutputLocation</code> in the workgroup's <code>ResultConfiguration</code> will be updated with the new value. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>",
@@ -981,7 +984,8 @@
981984
"KmsKey": {
982985
"base": null,
983986
"refs": {
984-
"CustomerContentEncryptionConfiguration$KmsKey": "<p>The customer managed KMS key that is used to encrypt the user's data stores in Athena.</p>"
987+
"CustomerContentEncryptionConfiguration$KmsKey": "<p>The customer managed KMS key that is used to encrypt the user's data stores in Athena.</p>",
988+
"ManagedQueryResultsEncryptionConfiguration$KmsKey": "<p>The ARN of an KMS key for encrypting managed query results.</p>"
985989
}
986990
},
987991
"ListApplicationDPUSizesInput": {
@@ -1148,6 +1152,26 @@
11481152
"SessionStatistics$DpuExecutionInMillis": "<p>The data processing unit execution time for a session in milliseconds.</p>"
11491153
}
11501154
},
1155+
"ManagedQueryResultsConfiguration": {
1156+
"base": "<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>",
1157+
"refs": {
1158+
"QueryExecution$ManagedQueryResultsConfiguration": "<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>",
1159+
"WorkGroupConfiguration$ManagedQueryResultsConfiguration": "<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>"
1160+
}
1161+
},
1162+
"ManagedQueryResultsConfigurationUpdates": {
1163+
"base": "<p>Updates the configuration for managed query results.</p>",
1164+
"refs": {
1165+
"WorkGroupConfigurationUpdates$ManagedQueryResultsConfigurationUpdates": "<p>Updates configuration information for managed query results in the workgroup.</p>"
1166+
}
1167+
},
1168+
"ManagedQueryResultsEncryptionConfiguration": {
1169+
"base": "<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>",
1170+
"refs": {
1171+
"ManagedQueryResultsConfiguration$EncryptionConfiguration": "<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>",
1172+
"ManagedQueryResultsConfigurationUpdates$EncryptionConfiguration": "<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>"
1173+
}
1174+
},
11511175
"MaxApplicationDPUSizesCount": {
11521176
"base": null,
11531177
"refs": {
@@ -1498,6 +1522,12 @@
14981522
"QueryExecution$Status": "<p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>"
14991523
}
15001524
},
1525+
"QueryResultType": {
1526+
"base": null,
1527+
"refs": {
1528+
"GetQueryResultsInput$QueryResultType": "<p> When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail. </p>"
1529+
}
1530+
},
15011531
"QueryResultsS3AccessGrantsConfiguration": {
15021532
"base": "<p>Specifies whether Amazon S3 access grants are enabled for query results.</p>",
15031533
"refs": {
@@ -1778,7 +1808,7 @@
17781808
"StatementType": {
17791809
"base": null,
17801810
"refs": {
1781-
"QueryExecution$StatementType": "<p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, <code>EXPLAIN</code>, <code>DESCRIBE</code>, or <code>SHOW TABLES</code>.</p>"
1811+
"QueryExecution$StatementType": "<p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, or <code>DESCRIBE TABLE</code>.</p>"
17821812
}
17831813
},
17841814
"StopCalculationExecutionRequest": {

generator/ServiceModels/athena/athena-2017-05-18.normal.json

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,6 +2516,10 @@
25162516
"MaxResults":{
25172517
"shape":"MaxQueryResults",
25182518
"documentation":"<p>The maximum number of results (rows) to return in this request.</p>"
2519+
},
2520+
"QueryResultType":{
2521+
"shape":"QueryResultType",
2522+
"documentation":"<p> When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail. </p>"
25192523
}
25202524
}
25212525
},
@@ -3304,6 +3308,50 @@
33043308
}
33053309
},
33063310
"Long":{"type":"long"},
3311+
"ManagedQueryResultsConfiguration":{
3312+
"type":"structure",
3313+
"required":["Enabled"],
3314+
"members":{
3315+
"Enabled":{
3316+
"shape":"Boolean",
3317+
"documentation":"<p>If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under <code>ResultConfiguration$OutputLocation</code>. The default is false. A workgroup cannot have the <code>ResultConfiguration$OutputLocation</code> parameter when you set this field to true. </p>"
3318+
},
3319+
"EncryptionConfiguration":{
3320+
"shape":"ManagedQueryResultsEncryptionConfiguration",
3321+
"documentation":"<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>"
3322+
}
3323+
},
3324+
"documentation":"<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>"
3325+
},
3326+
"ManagedQueryResultsConfigurationUpdates":{
3327+
"type":"structure",
3328+
"members":{
3329+
"Enabled":{
3330+
"shape":"BoxedBoolean",
3331+
"documentation":"<p>If set to true, specifies that Athena manages query results in Athena owned storage.</p>"
3332+
},
3333+
"EncryptionConfiguration":{
3334+
"shape":"ManagedQueryResultsEncryptionConfiguration",
3335+
"documentation":"<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>"
3336+
},
3337+
"RemoveEncryptionConfiguration":{
3338+
"shape":"BoxedBoolean",
3339+
"documentation":"<p>If set to true, it removes workgroup from Athena owned storage. The existing query results are cleaned up after 24hrs. You must provide query results in location specified under <code>ResultConfiguration$OutputLocation</code>.</p>"
3340+
}
3341+
},
3342+
"documentation":"<p>Updates the configuration for managed query results.</p>"
3343+
},
3344+
"ManagedQueryResultsEncryptionConfiguration":{
3345+
"type":"structure",
3346+
"required":["KmsKey"],
3347+
"members":{
3348+
"KmsKey":{
3349+
"shape":"KmsKey",
3350+
"documentation":"<p>The ARN of an KMS key for encrypting managed query results.</p>"
3351+
}
3352+
},
3353+
"documentation":"<p>If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information.</p>"
3354+
},
33073355
"MaxApplicationDPUSizesCount":{
33083356
"type":"integer",
33093357
"max":100,
@@ -3645,7 +3693,11 @@
36453693
},
36463694
"StatementType":{
36473695
"shape":"StatementType",
3648-
"documentation":"<p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, <code>EXPLAIN</code>, <code>DESCRIBE</code>, or <code>SHOW TABLES</code>.</p>"
3696+
"documentation":"<p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, or <code>DESCRIBE TABLE</code>.</p>"
3697+
},
3698+
"ManagedQueryResultsConfiguration":{
3699+
"shape":"ManagedQueryResultsConfiguration",
3700+
"documentation":"<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>"
36493701
},
36503702
"ResultConfiguration":{
36513703
"shape":"ResultConfiguration",
@@ -3798,6 +3850,13 @@
37983850
},
37993851
"documentation":"<p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>"
38003852
},
3853+
"QueryResultType":{
3854+
"type":"string",
3855+
"enum":[
3856+
"DATA_MANIFEST",
3857+
"DATA_ROWS"
3858+
]
3859+
},
38013860
"QueryResultsS3AccessGrantsConfiguration":{
38023861
"type":"structure",
38033862
"required":[
@@ -4904,6 +4963,10 @@
49044963
"shape":"ResultConfiguration",
49054964
"documentation":"<p>The configuration for the workgroup, which includes the location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query and calculation results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using <a>ResultConfiguration$OutputLocation</a>. If none of them is set, Athena issues an error that no output location is provided.</p>"
49064965
},
4966+
"ManagedQueryResultsConfiguration":{
4967+
"shape":"ManagedQueryResultsConfiguration",
4968+
"documentation":"<p> The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. </p>"
4969+
},
49074970
"EnforceWorkGroupConfiguration":{
49084971
"shape":"BoxedBoolean",
49094972
"documentation":"<p>If set to \"true\", the settings for the workgroup override client-side settings. If set to \"false\", client-side settings are used. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>"
@@ -4962,6 +5025,10 @@
49625025
"shape":"ResultConfigurationUpdates",
49635026
"documentation":"<p>The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results.</p>"
49645027
},
5028+
"ManagedQueryResultsConfigurationUpdates":{
5029+
"shape":"ManagedQueryResultsConfigurationUpdates",
5030+
"documentation":"<p>Updates configuration information for managed query results in the workgroup.</p>"
5031+
},
49655032
"PublishCloudWatchMetricsEnabled":{
49665033
"shape":"BoxedBoolean",
49675034
"documentation":"<p>Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.</p>"

sdk/code-analysis/ServiceAnalysis/Athena/Generated/PropertyValueRules.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,12 @@
10911091
<min>1</min>
10921092
<max>256</max>
10931093
</property-value-rule>
1094+
<property-value-rule>
1095+
<property>Amazon.Athena.Model.ManagedQueryResultsEncryptionConfiguration.KmsKey</property>
1096+
<min>1</min>
1097+
<max>2048</max>
1098+
<pattern>^arn:aws[a-z\-]*:kms:([a-z0-9\-]+):\d{12}:key/?[a-zA-Z_0-9+=,.@\-_/]+$|^arn:aws[a-z\-]*:kms:([a-z0-9\-]+):\d{12}:alias/?[a-zA-Z_0-9+=,.@\-_/]+$|^alias/[a-zA-Z0-9/_-]+$|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}</pattern>
1099+
</property-value-rule>
10941100
<property-value-rule>
10951101
<property>Amazon.Athena.Model.NamedQuery.Database</property>
10961102
<min>1</min>

sdk/src/Services/Athena/Generated/Model/GetQueryResultsRequest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public partial class GetQueryResultsRequest : AmazonAthenaRequest
5858
private int? _maxResults;
5959
private string _nextToken;
6060
private string _queryExecutionId;
61+
private QueryResultType _queryResultType;
6162

6263
/// <summary>
6364
/// Gets and sets the property MaxResults.
@@ -118,5 +119,27 @@ internal bool IsSetQueryExecutionId()
118119
return this._queryExecutionId != null;
119120
}
120121

122+
/// <summary>
123+
/// Gets and sets the property QueryResultType.
124+
/// <para>
125+
/// When you set this to <c>DATA_ROWS</c> or empty, <c>GetQueryResults</c> returns the
126+
/// query results in rows. If set to <c>DATA_MANIFEST</c>, it returns the manifest file
127+
/// in rows. Only the query types <c>CREATE TABLE AS SELECT</c>, <c>UNLOAD</c>, and <c>INSERT</c>
128+
/// can generate a manifest file. If you use <c>DATA_MANIFEST</c> for other query types,
129+
/// the query will fail.
130+
/// </para>
131+
/// </summary>
132+
public QueryResultType QueryResultType
133+
{
134+
get { return this._queryResultType; }
135+
set { this._queryResultType = value; }
136+
}
137+
138+
// Check to see if QueryResultType property is set
139+
internal bool IsSetQueryResultType()
140+
{
141+
return this._queryResultType != null;
142+
}
143+
121144
}
122145
}

0 commit comments

Comments
 (0)