amazonka-redshift-data-2.0: Amazon Redshift Data API Service 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.RedshiftData.DescribeStatement

Description

Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.

For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.

Synopsis

Creating a Request

data DescribeStatement Source #

See: newDescribeStatement smart constructor.

Constructors

DescribeStatement' 

Fields

  • id :: Text

    The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatement, and ListStatements.

Instances

Instances details
ToJSON DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

ToHeaders DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

ToPath DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

ToQuery DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

AWSRequest DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Associated Types

type AWSResponse DescribeStatement #

Generic DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Associated Types

type Rep DescribeStatement :: Type -> Type #

Read DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Show DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

NFData DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Methods

rnf :: DescribeStatement -> () #

Eq DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Hashable DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

type AWSResponse DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

type Rep DescribeStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

type Rep DescribeStatement = D1 ('MetaData "DescribeStatement" "Amazonka.RedshiftData.DescribeStatement" "amazonka-redshift-data-2.0-Hy9KEgtH5Bc3altuyuPuYo" 'False) (C1 ('MetaCons "DescribeStatement'" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

newDescribeStatement Source #

Create a value of DescribeStatement 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:

DescribeStatement, describeStatement_id - The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatement, and ListStatements.

Request Lenses

describeStatement_id :: Lens' DescribeStatement Text Source #

The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2 has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment, ExecuteStatement, and ListStatements.

Destructuring the Response

data DescribeStatementResponse Source #

See: newDescribeStatementResponse smart constructor.

Constructors

DescribeStatementResponse' 

Fields

  • clusterIdentifier :: Maybe Text

    The cluster identifier.

  • createdAt :: Maybe POSIX

    The date and time (UTC) when the SQL statement was submitted to run.

  • database :: Maybe Text

    The name of the database.

  • dbUser :: Maybe Text

    The database user name.

  • duration :: Maybe Integer

    The amount of time in nanoseconds that the statement ran.

  • error :: Maybe Text

    The error message from the cluster if the SQL statement encountered an error while running.

  • hasResultSet :: Maybe Bool

    A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set. The value is true if any substatement returns a result set.

  • queryParameters :: Maybe (NonEmpty SqlParameter)

    The parameters for the SQL statement.

  • queryString :: Maybe Text

    The SQL statement text.

  • redshiftPid :: Maybe Integer

    The process identifier from Amazon Redshift.

  • redshiftQueryId :: Maybe Integer

    The identifier of the query generated by Amazon Redshift. These identifiers are also available in the query column of the STL_QUERY system view.

  • resultRows :: Maybe Integer

    Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others. A -1 indicates the value is null.

  • resultSize :: Maybe Integer

    The size in bytes of the returned results. A -1 indicates the value is null.

  • secretArn :: Maybe Text

    The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

  • status :: Maybe StatusString

    The status of the SQL statement being described. Status values are defined as follows:

    • ABORTED - The query run was stopped by the user.
    • ALL - A status value that includes all query statuses. This value can be used to filter results.
    • FAILED - The query run failed.
    • FINISHED - The query has finished running.
    • PICKED - The query has been chosen to be run.
    • STARTED - The query run has started.
    • SUBMITTED - The query was submitted, but not yet processed.
  • subStatements :: Maybe [SubStatementData]

    The SQL statements from a multiple statement run.

  • updatedAt :: Maybe POSIX

    The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.

  • workgroupName :: Maybe Text

    The serverless workgroup name.

  • httpStatus :: Int

    The response's http status code.

  • id :: Text

    The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

Instances

Instances details
Generic DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Associated Types

type Rep DescribeStatementResponse :: Type -> Type #

Read DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Show DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

NFData DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

Eq DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

type Rep DescribeStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.DescribeStatement

type Rep DescribeStatementResponse = D1 ('MetaData "DescribeStatementResponse" "Amazonka.RedshiftData.DescribeStatement" "amazonka-redshift-data-2.0-Hy9KEgtH5Bc3altuyuPuYo" 'False) (C1 ('MetaCons "DescribeStatementResponse'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "clusterIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX))) :*: (S1 ('MetaSel ('Just "database") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "dbUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "duration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer))))) :*: ((S1 ('MetaSel ('Just "error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "hasResultSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "queryParameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty SqlParameter))) :*: (S1 ('MetaSel ('Just "queryString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "redshiftPid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)))))) :*: (((S1 ('MetaSel ('Just "redshiftQueryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "resultRows") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer))) :*: (S1 ('MetaSel ('Just "resultSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: (S1 ('MetaSel ('Just "secretArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe StatusString))))) :*: ((S1 ('MetaSel ('Just "subStatements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [SubStatementData])) :*: S1 ('MetaSel ('Just "updatedAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX))) :*: (S1 ('MetaSel ('Just "workgroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))))

newDescribeStatementResponse Source #

Create a value of DescribeStatementResponse 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:clusterIdentifier:DescribeStatementResponse', describeStatementResponse_clusterIdentifier - The cluster identifier.

DescribeStatementResponse, describeStatementResponse_createdAt - The date and time (UTC) when the SQL statement was submitted to run.

$sel:database:DescribeStatementResponse', describeStatementResponse_database - The name of the database.

$sel:dbUser:DescribeStatementResponse', describeStatementResponse_dbUser - The database user name.

DescribeStatementResponse, describeStatementResponse_duration - The amount of time in nanoseconds that the statement ran.

DescribeStatementResponse, describeStatementResponse_error - The error message from the cluster if the SQL statement encountered an error while running.

DescribeStatementResponse, describeStatementResponse_hasResultSet - A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set. The value is true if any substatement returns a result set.

DescribeStatementResponse, describeStatementResponse_queryParameters - The parameters for the SQL statement.

DescribeStatementResponse, describeStatementResponse_queryString - The SQL statement text.

$sel:redshiftPid:DescribeStatementResponse', describeStatementResponse_redshiftPid - The process identifier from Amazon Redshift.

DescribeStatementResponse, describeStatementResponse_redshiftQueryId - The identifier of the query generated by Amazon Redshift. These identifiers are also available in the query column of the STL_QUERY system view.

DescribeStatementResponse, describeStatementResponse_resultRows - Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others. A -1 indicates the value is null.

DescribeStatementResponse, describeStatementResponse_resultSize - The size in bytes of the returned results. A -1 indicates the value is null.

DescribeStatementResponse, describeStatementResponse_secretArn - The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

DescribeStatementResponse, describeStatementResponse_status - The status of the SQL statement being described. Status values are defined as follows:

  • ABORTED - The query run was stopped by the user.
  • ALL - A status value that includes all query statuses. This value can be used to filter results.
  • FAILED - The query run failed.
  • FINISHED - The query has finished running.
  • PICKED - The query has been chosen to be run.
  • STARTED - The query run has started.
  • SUBMITTED - The query was submitted, but not yet processed.

$sel:subStatements:DescribeStatementResponse', describeStatementResponse_subStatements - The SQL statements from a multiple statement run.

DescribeStatementResponse, describeStatementResponse_updatedAt - The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.

$sel:workgroupName:DescribeStatementResponse', describeStatementResponse_workgroupName - The serverless workgroup name.

$sel:httpStatus:DescribeStatementResponse', describeStatementResponse_httpStatus - The response's http status code.

DescribeStatement, describeStatementResponse_id - The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

Response Lenses

describeStatementResponse_createdAt :: Lens' DescribeStatementResponse (Maybe UTCTime) Source #

The date and time (UTC) when the SQL statement was submitted to run.

describeStatementResponse_duration :: Lens' DescribeStatementResponse (Maybe Integer) Source #

The amount of time in nanoseconds that the statement ran.

describeStatementResponse_error :: Lens' DescribeStatementResponse (Maybe Text) Source #

The error message from the cluster if the SQL statement encountered an error while running.

describeStatementResponse_hasResultSet :: Lens' DescribeStatementResponse (Maybe Bool) Source #

A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set. The value is true if any substatement returns a result set.

describeStatementResponse_redshiftQueryId :: Lens' DescribeStatementResponse (Maybe Integer) Source #

The identifier of the query generated by Amazon Redshift. These identifiers are also available in the query column of the STL_QUERY system view.

describeStatementResponse_resultRows :: Lens' DescribeStatementResponse (Maybe Integer) Source #

Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others. A -1 indicates the value is null.

describeStatementResponse_resultSize :: Lens' DescribeStatementResponse (Maybe Integer) Source #

The size in bytes of the returned results. A -1 indicates the value is null.

describeStatementResponse_secretArn :: Lens' DescribeStatementResponse (Maybe Text) Source #

The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

describeStatementResponse_status :: Lens' DescribeStatementResponse (Maybe StatusString) Source #

The status of the SQL statement being described. Status values are defined as follows:

  • ABORTED - The query run was stopped by the user.
  • ALL - A status value that includes all query statuses. This value can be used to filter results.
  • FAILED - The query run failed.
  • FINISHED - The query has finished running.
  • PICKED - The query has been chosen to be run.
  • STARTED - The query run has started.
  • SUBMITTED - The query was submitted, but not yet processed.

describeStatementResponse_updatedAt :: Lens' DescribeStatementResponse (Maybe UTCTime) Source #

The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.

describeStatementResponse_id :: Lens' DescribeStatementResponse Text Source #

The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.