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개 답변
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인