Timestream Bug Report/ Help Request: `ORDER BY` works in Query Editor via Web App but not Query String sent via AWS SDK

0

Hi aws re:Post!

I used the AWS Timestream Web App Query Editor while developing my CDK IaC to test certain queries - specifically, I run the following and receive 1000 rows in response:

SELECT measure_value::varchar FROM DATABASE.TABLE ORDER BY time LIMIT 1000

However the same exact query sent in NodeJS via aws-sdk/TimestreamQuery returns 0 rows in response. If I remove ORDER BY time such that my query is:

SELECT measure_value::varchar FROM DATABASE.TABLE LIMIT 1000

the NodeJS Query client receives the same data as in the AWS Timestream Web App Query Editor. This is very bizarre behavior- I have not found any mention of it whatsoever in the context of AWS Timestream, and the only contextual results I found on the internet was MySQL Bug Report #70466 (accompanying stack overflow post).

This really does not seem like a software configuration issue - to reiterate, if I omit ORDER BY time my NodeJS client behaves the same as my Web App client. Any insight on how to resolve this would be greatly appreciated!

1 Answer
0

You will need to paginate on the response to get the full results. The AWS Timestream Web App Query Editor does the pagination and hence you see the results. A sample pagination code for the NodeJS query client is available at https://github.com/awslabs/amazon-timestream-tools/blob/mainline/sample_apps_reinvent2021/js/query-example.js#L244-L254. The pagination continues until the response does not contain a pagination token.

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions