I am using the node @aws-sdk/client-timestream-query 3.53.0 package. I am running into an issue where the result of ProgressPercentage is not 100 but the promise returned.
const promise = this.client
.send(command)
.then((data) => parse(data))
.catch((err) => err);
this.cache.set('accountPlatforms', promise);
return (await this.cache.get('accountPlatforms')) || []
Then inconsistently we will get results that return like this from the promise.
{
"$metadata": {
"attempts": 1,
"httpStatusCode": 200,
"requestId": "redacted",
"totalRetryDelay": 0
},
"ColumnInfo": [
{
"Name": "platform",
"Type": [
null
]
},
{
"Name": "success",
"Type": [
null
]
},
{
"Name": "failure",
"Type": [
null
]
},
{
"Name": "total",
"Type": [
null
]
}
],
"NextToken": "redacted",
"QueryId": "redacted",
"QueryStatus": {
"CumulativeBytesMetered": 10000000,
"CumulativeBytesScanned": 108896,
"ProgressPercentage": 67.63129689174706
},
"Rows": [
]
}
I don't see a way to look up the completed query either by requestId or queryId from inside the our service.
Anyone know how to get the completed query?
You need to use the "NextToken" from the first query result you obtain and use it to make a new query using it, if the ProgressPercentage<100. You will then have the result.
This is the way i do.
Like in Python i do:
if query['QueryStatus']['ProgressPercentage']<100:
next_token = query['NextToken']
query = timestream_query_client.query(QueryString=queryString, NextToken=next_token)
Hope it helps also after time or who is coming next having the same problem.