PrepareQuery - Amazon Timestream

PrepareQuery

A synchronous operation that allows you to submit a query with parameters to be stored by Timestream for later running. Timestream only supports using this operation with ValidateOnly set to true.

Request Syntax

{ "QueryString": "string", "ValidateOnly": boolean }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

QueryString

The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string @ character followed by an identifier.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 262144.

Required: Yes

ValidateOnly

By setting this value to true, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.

Type: Boolean

Required: No

Response Syntax

{ "Columns": [ { "Aliased": boolean, "DatabaseName": "string", "Name": "string", "TableName": "string", "Type": { "ArrayColumnInfo": { "Name": "string", "Type": "Type" }, "RowColumnInfo": [ { "Name": "string", "Type": "Type" } ], "ScalarType": "string", "TimeSeriesMeasureValueColumnInfo": { "Name": "string", "Type": "Type" } } } ], "Parameters": [ { "Name": "string", "Type": { "ArrayColumnInfo": { "Name": "string", "Type": "Type" }, "RowColumnInfo": [ { "Name": "string", "Type": "Type" } ], "ScalarType": "string", "TimeSeriesMeasureValueColumnInfo": { "Name": "string", "Type": "Type" } } } ], "QueryString": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Columns

A list of SELECT clause columns of the submitted query string.

Type: Array of SelectColumn objects

Parameters

A list of parameters used in the submitted query string.

Type: Array of ParameterMapping objects

QueryString

The query string that you want prepare.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 262144.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You are not authorized to perform this action.

HTTP Status Code: 400

InternalServerException

Timestream was unable to fully process this request because of an internal server error.

HTTP Status Code: 400

InvalidEndpointException

The requested endpoint was not valid.

HTTP Status Code: 400

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

ValidationException

Invalid or malformed request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: