amazonka-athena-2.0: Amazon Athena SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Athena.GetQueryResults

Description

Streams the results of a single query execution specified by QueryExecutionId from the Athena query results location in Amazon S3. For more information, see Query Results in the Amazon Athena User Guide. This request does not execute the query but returns results. Use StartQueryExecution to run a query.

To stream query results successfully, the IAM principal with permission to call GetQueryResults also must have permissions to the Amazon S3 GetObject action for the Athena query results location.

IAM principals with permission to the Amazon S3 GetObject action for the query results location are able to retrieve query results from Amazon S3 even if permission to the GetQueryResults action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied.

This operation returns paginated results.

Synopsis

Creating a Request

data GetQueryResults Source #

See: newGetQueryResults smart constructor.

Constructors

GetQueryResults' 

Fields

  • maxResults :: Maybe Natural

    The maximum number of results (rows) to return in this request.

  • nextToken :: Maybe Text

    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 NextToken from the response object of the previous page call.

  • queryExecutionId :: Text

    The unique ID of the query execution.

Instances

Instances details
ToJSON GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

ToHeaders GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

ToPath GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

ToQuery GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

AWSPager GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

AWSRequest GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Associated Types

type AWSResponse GetQueryResults #

Generic GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Associated Types

type Rep GetQueryResults :: Type -> Type #

Read GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Show GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

NFData GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Methods

rnf :: GetQueryResults -> () #

Eq GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Hashable GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

type AWSResponse GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

type Rep GetQueryResults Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

type Rep GetQueryResults = D1 ('MetaData "GetQueryResults" "Amazonka.Athena.GetQueryResults" "amazonka-athena-2.0-1BJA3HTvHJNEzwQRaEw59w" 'False) (C1 ('MetaCons "GetQueryResults'" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "queryExecutionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newGetQueryResults Source #

Create a value of GetQueryResults with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:maxResults:GetQueryResults', getQueryResults_maxResults - The maximum number of results (rows) to return in this request.

GetQueryResults, getQueryResults_nextToken - 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 NextToken from the response object of the previous page call.

GetQueryResults, getQueryResults_queryExecutionId - The unique ID of the query execution.

Request Lenses

getQueryResults_maxResults :: Lens' GetQueryResults (Maybe Natural) Source #

The maximum number of results (rows) to return in this request.

getQueryResults_nextToken :: Lens' GetQueryResults (Maybe Text) Source #

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 NextToken from the response object of the previous page call.

getQueryResults_queryExecutionId :: Lens' GetQueryResults Text Source #

The unique ID of the query execution.

Destructuring the Response

data GetQueryResultsResponse Source #

See: newGetQueryResultsResponse smart constructor.

Constructors

GetQueryResultsResponse' 

Fields

  • nextToken :: Maybe Text

    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 NextToken from the response object of the previous page call.

  • resultSet :: Maybe ResultSet

    The results of the query execution.

  • updateCount :: Maybe Integer

    The number of rows inserted with a CREATE TABLE AS SELECT statement.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Associated Types

type Rep GetQueryResultsResponse :: Type -> Type #

Read GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Show GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

NFData GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

Methods

rnf :: GetQueryResultsResponse -> () #

Eq GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

type Rep GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.Athena.GetQueryResults

type Rep GetQueryResultsResponse = D1 ('MetaData "GetQueryResultsResponse" "Amazonka.Athena.GetQueryResults" "amazonka-athena-2.0-1BJA3HTvHJNEzwQRaEw59w" 'False) (C1 ('MetaCons "GetQueryResultsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "resultSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ResultSet))) :*: (S1 ('MetaSel ('Just "updateCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newGetQueryResultsResponse Source #

Create a value of GetQueryResultsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

GetQueryResults, getQueryResultsResponse_nextToken - 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 NextToken from the response object of the previous page call.

$sel:resultSet:GetQueryResultsResponse', getQueryResultsResponse_resultSet - The results of the query execution.

$sel:updateCount:GetQueryResultsResponse', getQueryResultsResponse_updateCount - The number of rows inserted with a CREATE TABLE AS SELECT statement.

$sel:httpStatus:GetQueryResultsResponse', getQueryResultsResponse_httpStatus - The response's http status code.

Response Lenses

getQueryResultsResponse_nextToken :: Lens' GetQueryResultsResponse (Maybe Text) Source #

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 NextToken from the response object of the previous page call.

getQueryResultsResponse_updateCount :: Lens' GetQueryResultsResponse (Maybe Integer) Source #

The number of rows inserted with a CREATE TABLE AS SELECT statement.