Query
timestreamquery_query | R Documentation |
Query is a synchronous operation that enables you to run a query against your Amazon Timestream data¶
Description¶
query
is a synchronous operation that enables you to run a query
against your Amazon Timestream data.
If you enabled QueryInsights
, this API also returns insights and
metrics related to the query that you executed. QueryInsights
helps
with performance tuning of your query. For more information about
QueryInsights
, see Using query insights to optimize queries in Amazon
Timestream.
The maximum number of query
API requests you're allowed to make with
QueryInsights
enabled is 1 query per second (QPS). If you exceed this
query rate, it might result in throttling.
query
will time out after 60 seconds. You must update the default
timeout in the SDK to support a timeout of 60 seconds. See the code
sample
for details.
Your query request will fail in the following cases:
-
If you submit a
query
request with the same client token outside of the 5-minute idempotency window. -
If you submit a
query
request with the same client token, but change other parameters, within the 5-minute idempotency window. -
If the size of the row (including the query metadata) exceeds 1 MB, then the query will fail with the following error message:
Query aborted as max page response size has been exceeded by the output result row
-
If the IAM principal of the query initiator and the result reader are not the same and/or the query initiator and the result reader do not have the same query string in the query requests, the query will fail with an
Invalid pagination token
error.
Usage¶
timestreamquery_query(QueryString, ClientToken, NextToken, MaxRows,
QueryInsights)
Arguments¶
QueryString |
[required] The query to be run by Timestream. |
ClientToken |
Unique, case-sensitive string of up to 64 ASCII characters
specified when a
|
NextToken |
A pagination token used to return a set of results. When the
Note the following when using NextToken in a query:
|
MaxRows |
The total number of rows to be returned in the
Otherwise, the initial invocation of If the row size is large (e.g. a row has many columns), Timestream
may return fewer rows to keep the response size from exceeding the 1 MB
limit. If |
QueryInsights |
Encapsulates settings for enabling
Enabling |
Value¶
A list with the following syntax:
list(
QueryId = "string",
NextToken = "string",
Rows = list(
list(
Data = list(
list(
ScalarValue = "string",
TimeSeriesValue = list(
list(
Time = "string",
Value = list()
)
),
ArrayValue = list(),
RowValue = list(),
NullValue = TRUE|FALSE
)
)
)
),
ColumnInfo = list(
list(
Name = "string",
Type = list(
ScalarType = "VARCHAR"|"BOOLEAN"|"BIGINT"|"DOUBLE"|"TIMESTAMP"|"DATE"|"TIME"|"INTERVAL_DAY_TO_SECOND"|"INTERVAL_YEAR_TO_MONTH"|"UNKNOWN"|"INTEGER",
ArrayColumnInfo = list(),
TimeSeriesMeasureValueColumnInfo = list(),
RowColumnInfo = list()
)
)
),
QueryStatus = list(
ProgressPercentage = 123.0,
CumulativeBytesScanned = 123,
CumulativeBytesMetered = 123
),
QueryInsightsResponse = list(
QuerySpatialCoverage = list(
Max = list(
Value = 123.0,
TableArn = "string",
PartitionKey = list(
"string"
)
)
),
QueryTemporalRange = list(
Max = list(
Value = 123,
TableArn = "string"
)
),
QueryTableCount = 123,
OutputRows = 123,
OutputBytes = 123,
UnloadPartitionCount = 123,
UnloadWrittenRows = 123,
UnloadWrittenBytes = 123
)
)
Request syntax¶
svc$query(
QueryString = "string",
ClientToken = "string",
NextToken = "string",
MaxRows = 123,
QueryInsights = list(
Mode = "ENABLED_WITH_RATE_CONTROL"|"DISABLED"
)
)