Skip to content

Commit 37c86ce

Browse files
author
AWS
committed
Amazon Athena Update: Adds APIs to create, list, update, and delete prepared SQL statements that have optional placeholder parameters. A prepared statement can use different values for these parameters each time it is run.
1 parent f273d78 commit 37c86ce

File tree

3 files changed

+283
-0
lines changed

3 files changed

+283
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "Amazon Athena",
4+
"contributor": "",
5+
"description": "Adds APIs to create, list, update, and delete prepared SQL statements that have optional placeholder parameters. A prepared statement can use different values for these parameters each time it is run."
6+
}

services/athena/src/main/resources/codegen-resources/paginators-1.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"limit_key": "MaxResults",
2323
"output_token": "NextToken"
2424
},
25+
"ListPreparedStatements": {
26+
"input_token": "NextToken",
27+
"limit_key": "MaxResults",
28+
"output_token": "NextToken"
29+
},
2530
"ListQueryExecutions": {
2631
"input_token": "NextToken",
2732
"limit_key": "MaxResults",

services/athena/src/main/resources/codegen-resources/service-2.json

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@
6969
"documentation":"<p>Creates a named query in the specified workgroup. Requires that you have access to the workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>",
7070
"idempotent":true
7171
},
72+
"CreatePreparedStatement":{
73+
"name":"CreatePreparedStatement",
74+
"http":{
75+
"method":"POST",
76+
"requestUri":"/"
77+
},
78+
"input":{"shape":"CreatePreparedStatementInput"},
79+
"output":{"shape":"CreatePreparedStatementOutput"},
80+
"errors":[
81+
{"shape":"InternalServerException"},
82+
{"shape":"InvalidRequestException"}
83+
],
84+
"documentation":"<p>Creates a prepared statement for use with SQL queries in Athena.</p>"
85+
},
7286
"CreateWorkGroup":{
7387
"name":"CreateWorkGroup",
7488
"http":{
@@ -112,6 +126,21 @@
112126
"documentation":"<p>Deletes the named query if you have access to the workgroup in which the query was saved.</p> <p>For code samples using the AWS SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>",
113127
"idempotent":true
114128
},
129+
"DeletePreparedStatement":{
130+
"name":"DeletePreparedStatement",
131+
"http":{
132+
"method":"POST",
133+
"requestUri":"/"
134+
},
135+
"input":{"shape":"DeletePreparedStatementInput"},
136+
"output":{"shape":"DeletePreparedStatementOutput"},
137+
"errors":[
138+
{"shape":"InternalServerException"},
139+
{"shape":"InvalidRequestException"},
140+
{"shape":"ResourceNotFoundException"}
141+
],
142+
"documentation":"<p>Deletes the prepared statement with the specified name from the specified workgroup.</p>"
143+
},
115144
"DeleteWorkGroup":{
116145
"name":"DeleteWorkGroup",
117146
"http":{
@@ -170,6 +199,21 @@
170199
],
171200
"documentation":"<p>Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.</p>"
172201
},
202+
"GetPreparedStatement":{
203+
"name":"GetPreparedStatement",
204+
"http":{
205+
"method":"POST",
206+
"requestUri":"/"
207+
},
208+
"input":{"shape":"GetPreparedStatementInput"},
209+
"output":{"shape":"GetPreparedStatementOutput"},
210+
"errors":[
211+
{"shape":"InternalServerException"},
212+
{"shape":"InvalidRequestException"},
213+
{"shape":"ResourceNotFoundException"}
214+
],
215+
"documentation":"<p>Retrieves the prepared statement with the specified name from the specified workgroup.</p>"
216+
},
173217
"GetQueryExecution":{
174218
"name":"GetQueryExecution",
175219
"http":{
@@ -284,6 +328,20 @@
284328
],
285329
"documentation":"<p>Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>"
286330
},
331+
"ListPreparedStatements":{
332+
"name":"ListPreparedStatements",
333+
"http":{
334+
"method":"POST",
335+
"requestUri":"/"
336+
},
337+
"input":{"shape":"ListPreparedStatementsInput"},
338+
"output":{"shape":"ListPreparedStatementsOutput"},
339+
"errors":[
340+
{"shape":"InternalServerException"},
341+
{"shape":"InvalidRequestException"}
342+
],
343+
"documentation":"<p>Lists the prepared statements in the specfied workgroup.</p>"
344+
},
287345
"ListQueryExecutions":{
288346
"name":"ListQueryExecutions",
289347
"http":{
@@ -417,6 +475,21 @@
417475
],
418476
"documentation":"<p>Updates the data catalog that has the specified name.</p>"
419477
},
478+
"UpdatePreparedStatement":{
479+
"name":"UpdatePreparedStatement",
480+
"http":{
481+
"method":"POST",
482+
"requestUri":"/"
483+
},
484+
"input":{"shape":"UpdatePreparedStatementInput"},
485+
"output":{"shape":"UpdatePreparedStatementOutput"},
486+
"errors":[
487+
{"shape":"InternalServerException"},
488+
{"shape":"InvalidRequestException"},
489+
{"shape":"ResourceNotFoundException"}
490+
],
491+
"documentation":"<p>Updates a prepared statement.</p>"
492+
},
420493
"UpdateWorkGroup":{
421494
"name":"UpdateWorkGroup",
422495
"http":{
@@ -665,6 +738,37 @@
665738
}
666739
}
667740
},
741+
"CreatePreparedStatementInput":{
742+
"type":"structure",
743+
"required":[
744+
"StatementName",
745+
"WorkGroup",
746+
"QueryStatement"
747+
],
748+
"members":{
749+
"StatementName":{
750+
"shape":"StatementName",
751+
"documentation":"<p>The name of the prepared statement.</p>"
752+
},
753+
"WorkGroup":{
754+
"shape":"WorkGroupName",
755+
"documentation":"<p>The name of the workgroup to which the prepared statement belongs.</p>"
756+
},
757+
"QueryStatement":{
758+
"shape":"QueryString",
759+
"documentation":"<p>The query string for the prepared statement.</p>"
760+
},
761+
"Description":{
762+
"shape":"DescriptionString",
763+
"documentation":"<p>The description of the prepared statement.</p>"
764+
}
765+
}
766+
},
767+
"CreatePreparedStatementOutput":{
768+
"type":"structure",
769+
"members":{
770+
}
771+
},
668772
"CreateWorkGroupInput":{
669773
"type":"structure",
670774
"required":["Name"],
@@ -814,6 +918,28 @@
814918
"members":{
815919
}
816920
},
921+
"DeletePreparedStatementInput":{
922+
"type":"structure",
923+
"required":[
924+
"StatementName",
925+
"WorkGroup"
926+
],
927+
"members":{
928+
"StatementName":{
929+
"shape":"StatementName",
930+
"documentation":"<p>The name of the prepared statement to delete.</p>"
931+
},
932+
"WorkGroup":{
933+
"shape":"WorkGroupName",
934+
"documentation":"<p>The workgroup to which the statement to be deleted belongs.</p>"
935+
}
936+
}
937+
},
938+
"DeletePreparedStatementOutput":{
939+
"type":"structure",
940+
"members":{
941+
}
942+
},
817943
"DeleteWorkGroupInput":{
818944
"type":"structure",
819945
"required":["WorkGroup"],
@@ -957,6 +1083,32 @@
9571083
}
9581084
}
9591085
},
1086+
"GetPreparedStatementInput":{
1087+
"type":"structure",
1088+
"required":[
1089+
"StatementName",
1090+
"WorkGroup"
1091+
],
1092+
"members":{
1093+
"StatementName":{
1094+
"shape":"StatementName",
1095+
"documentation":"<p>The name of the prepared statement to retrieve.</p>"
1096+
},
1097+
"WorkGroup":{
1098+
"shape":"WorkGroupName",
1099+
"documentation":"<p>The workgroup to which the statement to be retrieved belongs.</p>"
1100+
}
1101+
}
1102+
},
1103+
"GetPreparedStatementOutput":{
1104+
"type":"structure",
1105+
"members":{
1106+
"PreparedStatement":{
1107+
"shape":"PreparedStatement",
1108+
"documentation":"<p>The name of the prepared statement that was retrieved.</p>"
1109+
}
1110+
}
1111+
},
9601112
"GetQueryExecutionInput":{
9611113
"type":"structure",
9621114
"required":["QueryExecutionId"],
@@ -1204,6 +1356,37 @@
12041356
}
12051357
}
12061358
},
1359+
"ListPreparedStatementsInput":{
1360+
"type":"structure",
1361+
"required":["WorkGroup"],
1362+
"members":{
1363+
"WorkGroup":{
1364+
"shape":"WorkGroupName",
1365+
"documentation":"<p>The workgroup to list the prepared statements for.</p>"
1366+
},
1367+
"NextToken":{
1368+
"shape":"Token",
1369+
"documentation":"<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>"
1370+
},
1371+
"MaxResults":{
1372+
"shape":"MaxPreparedStatementsCount",
1373+
"documentation":"<p>The maximum number of results to return in this request.</p>"
1374+
}
1375+
}
1376+
},
1377+
"ListPreparedStatementsOutput":{
1378+
"type":"structure",
1379+
"members":{
1380+
"PreparedStatements":{
1381+
"shape":"PreparedStatementsList",
1382+
"documentation":"<p>The list of prepared statements for the workgroup.</p>"
1383+
},
1384+
"NextToken":{
1385+
"shape":"Token",
1386+
"documentation":"<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>"
1387+
}
1388+
}
1389+
},
12071390
"ListQueryExecutionsInput":{
12081391
"type":"structure",
12091392
"members":{
@@ -1358,6 +1541,12 @@
13581541
"max":50,
13591542
"min":0
13601543
},
1544+
"MaxPreparedStatementsCount":{
1545+
"type":"integer",
1546+
"box":true,
1547+
"max":50,
1548+
"min":1
1549+
},
13611550
"MaxQueryExecutionsCount":{
13621551
"type":"integer",
13631552
"box":true,
@@ -1455,6 +1644,52 @@
14551644
"type":"string",
14561645
"max":51200
14571646
},
1647+
"PreparedStatement":{
1648+
"type":"structure",
1649+
"members":{
1650+
"StatementName":{
1651+
"shape":"StatementName",
1652+
"documentation":"<p>The name of the prepared statement.</p>"
1653+
},
1654+
"QueryStatement":{
1655+
"shape":"QueryString",
1656+
"documentation":"<p>The query string for the prepared statement.</p>"
1657+
},
1658+
"WorkGroupName":{
1659+
"shape":"WorkGroupName",
1660+
"documentation":"<p>The name of the workgroup to which the prepared statement belongs.</p>"
1661+
},
1662+
"Description":{
1663+
"shape":"DescriptionString",
1664+
"documentation":"<p>The description of the prepared statement.</p>"
1665+
},
1666+
"LastModifiedTime":{
1667+
"shape":"Date",
1668+
"documentation":"<p>The last modified time of the prepared statement.</p>"
1669+
}
1670+
},
1671+
"documentation":"<p>A prepared SQL statement for use with Athena.</p>"
1672+
},
1673+
"PreparedStatementSummary":{
1674+
"type":"structure",
1675+
"members":{
1676+
"StatementName":{
1677+
"shape":"StatementName",
1678+
"documentation":"<p>The name of the prepared statement.</p>"
1679+
},
1680+
"LastModifiedTime":{
1681+
"shape":"Date",
1682+
"documentation":"<p>The last modified time of the prepared statement.</p>"
1683+
}
1684+
},
1685+
"documentation":"<p>The name and last modified time of the prepared statement.</p>"
1686+
},
1687+
"PreparedStatementsList":{
1688+
"type":"list",
1689+
"member":{"shape":"PreparedStatementSummary"},
1690+
"max":50,
1691+
"min":0
1692+
},
14581693
"QueryExecution":{
14591694
"type":"structure",
14601695
"members":{
@@ -1712,6 +1947,12 @@
17121947
}
17131948
}
17141949
},
1950+
"StatementName":{
1951+
"type":"string",
1952+
"max":256,
1953+
"min":1,
1954+
"pattern":"[a-zA-Z_][a-zA-Z0-9_@:]{1,256}"
1955+
},
17151956
"StatementType":{
17161957
"type":"string",
17171958
"enum":[
@@ -1956,6 +2197,37 @@
19562197
"members":{
19572198
}
19582199
},
2200+
"UpdatePreparedStatementInput":{
2201+
"type":"structure",
2202+
"required":[
2203+
"StatementName",
2204+
"WorkGroup",
2205+
"QueryStatement"
2206+
],
2207+
"members":{
2208+
"StatementName":{
2209+
"shape":"StatementName",
2210+
"documentation":"<p>The name of the prepared statement.</p>"
2211+
},
2212+
"WorkGroup":{
2213+
"shape":"WorkGroupName",
2214+
"documentation":"<p>The workgroup for the prepared statement.</p>"
2215+
},
2216+
"QueryStatement":{
2217+
"shape":"QueryString",
2218+
"documentation":"<p>The query string for the prepared statement.</p>"
2219+
},
2220+
"Description":{
2221+
"shape":"DescriptionString",
2222+
"documentation":"<p>The description of the prepared statement.</p>"
2223+
}
2224+
}
2225+
},
2226+
"UpdatePreparedStatementOutput":{
2227+
"type":"structure",
2228+
"members":{
2229+
}
2230+
},
19592231
"UpdateWorkGroupInput":{
19602232
"type":"structure",
19612233
"required":["WorkGroup"],

0 commit comments

Comments
 (0)