/AWS1/IF_ATH=>STARTQUERYEXECUTION()¶
About StartQueryExecution¶
Runs the SQL query statements contained in the Query. Requires you to
have access to the workgroup in which the query ran. Running queries against an external
catalog requires GetDataCatalog permission to the catalog. For code
samples using the Amazon Web Services SDK for Java, see Examples and
Code Samples in the Amazon Athena User
Guide.
Method Signature¶
METHODS /AWS1/IF_ATH~STARTQUERYEXECUTION
IMPORTING
!IV_QUERYSTRING TYPE /AWS1/ATHQUERYSTRING OPTIONAL
!IV_CLIENTREQUESTTOKEN TYPE /AWS1/ATHIDEMPOTENCYTOKEN OPTIONAL
!IO_QUERYEXECUTIONCONTEXT TYPE REF TO /AWS1/CL_ATHQUERYEXECCONTEXT OPTIONAL
!IO_RESULTCONFIGURATION TYPE REF TO /AWS1/CL_ATHRESULTCONF OPTIONAL
!IV_WORKGROUP TYPE /AWS1/ATHWORKGROUPNAME OPTIONAL
!IT_EXECUTIONPARAMETERS TYPE /AWS1/CL_ATHEXECUTIONPARAMS_W=>TT_EXECUTIONPARAMETERS OPTIONAL
!IO_RESULTREUSECONFIGURATION TYPE REF TO /AWS1/CL_ATHRESULTREUSECONF OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_athstartqueryexecout
RAISING
/AWS1/CX_ATHINTERNALSERVEREX
/AWS1/CX_ATHINVALIDREQUESTEX
/AWS1/CX_ATHTOOMANYREQUESTSEX
/AWS1/CX_ATHCLIENTEXC
/AWS1/CX_ATHSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_querystring TYPE /AWS1/ATHQUERYSTRING /AWS1/ATHQUERYSTRING¶
The SQL query statements to be executed.
Optional arguments:¶
iv_clientrequesttoken TYPE /AWS1/ATHIDEMPOTENCYTOKEN /AWS1/ATHIDEMPOTENCYTOKEN¶
A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another
StartQueryExecutionrequest is received, the same response is returned and another query is not created. An error is returned if a parameter, such asQueryString, has changed. A call toStartQueryExecutionthat uses a previous client request token returns the sameQueryExecutionIdeven if the requester doesn't have permission on the tables specified inQueryString.This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.
io_queryexecutioncontext TYPE REF TO /AWS1/CL_ATHQUERYEXECCONTEXT /AWS1/CL_ATHQUERYEXECCONTEXT¶
The database within which the query executes.
io_resultconfiguration TYPE REF TO /AWS1/CL_ATHRESULTCONF /AWS1/CL_ATHRESULTCONF¶
Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
iv_workgroup TYPE /AWS1/ATHWORKGROUPNAME /AWS1/ATHWORKGROUPNAME¶
The name of the workgroup in which the query is being started.
it_executionparameters TYPE /AWS1/CL_ATHEXECUTIONPARAMS_W=>TT_EXECUTIONPARAMETERS TT_EXECUTIONPARAMETERS¶
A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.
io_resultreuseconfiguration TYPE REF TO /AWS1/CL_ATHRESULTREUSECONF /AWS1/CL_ATHRESULTREUSECONF¶
Specifies the query result reuse behavior for the query.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_athstartqueryexecout /AWS1/CL_ATHSTARTQUERYEXECOUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->startqueryexecution(
io_queryexecutioncontext = new /aws1/cl_athqueryexeccontext(
iv_catalog = |string|
iv_database = |string|
)
io_resultconfiguration = new /aws1/cl_athresultconf(
io_aclconfiguration = new /aws1/cl_athaclconfiguration( |string| )
io_encryptionconfiguration = new /aws1/cl_athencryptionconf(
iv_encryptionoption = |string|
iv_kmskey = |string|
)
iv_expectedbucketowner = |string|
iv_outputlocation = |string|
)
io_resultreuseconfiguration = new /aws1/cl_athresultreuseconf(
io_resultreusebyageconf = new /aws1/cl_athrsltreusebyageconf(
iv_enabled = ABAP_TRUE
iv_maxageinminutes = 123
)
)
it_executionparameters = VALUE /aws1/cl_athexecutionparams_w=>tt_executionparameters(
( new /aws1/cl_athexecutionparams_w( |string| ) )
)
iv_clientrequesttoken = |string|
iv_querystring = |string|
iv_workgroup = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_queryexecutionid = lo_result->get_queryexecutionid( ).
ENDIF.