Skip to content

Commit

Permalink
feat(client-timestream-query): This release adds support for Query In…
Browse files Browse the repository at this point in the history
…sights, a feature that provides details of query execution, enabling users to identify areas for improvement to optimize their queries, resulting in improved query performance and lower query costs.
  • Loading branch information
awstools committed Oct 22, 2024
1 parent fa3d3d0 commit 2caa046
Show file tree
Hide file tree
Showing 7 changed files with 757 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/client-timestream-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AWS SDK for JavaScript TimestreamQuery Client for Node.js, Browser and React Nat

## Installing

To install the this package, simply type add or install @aws-sdk/client-timestream-query
To install this package, simply type add or install @aws-sdk/client-timestream-query
using your favorite package manager:

- `npm install @aws-sdk/client-timestream-query`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,26 @@ export interface DescribeScheduledQueryCommandOutput extends DescribeScheduledQu
* // RecordsIngested: Number("long"),
* // QueryResultRows: Number("long"),
* // },
* // QueryInsightsResponse: { // ScheduledQueryInsightsResponse
* // QuerySpatialCoverage: { // QuerySpatialCoverage
* // Max: { // QuerySpatialCoverageMax
* // Value: Number("double"),
* // TableArn: "STRING_VALUE",
* // PartitionKey: [ // PartitionKeyList
* // "STRING_VALUE",
* // ],
* // },
* // },
* // QueryTemporalRange: { // QueryTemporalRange
* // Max: { // QueryTemporalRangeMax
* // Value: Number("long"),
* // TableArn: "STRING_VALUE",
* // },
* // },
* // QueryTableCount: Number("long"),
* // OutputRows: Number("long"),
* // OutputBytes: Number("long"),
* // },
* // ErrorReportLocation: { // ErrorReportLocation
* // S3ReportLocation: { // S3ReportLocation
* // BucketName: "STRING_VALUE",
Expand All @@ -143,6 +163,26 @@ export interface DescribeScheduledQueryCommandOutput extends DescribeScheduledQu
* // RecordsIngested: Number("long"),
* // QueryResultRows: Number("long"),
* // },
* // QueryInsightsResponse: {
* // QuerySpatialCoverage: {
* // Max: {
* // Value: Number("double"),
* // TableArn: "STRING_VALUE",
* // PartitionKey: [
* // "STRING_VALUE",
* // ],
* // },
* // },
* // QueryTemporalRange: {
* // Max: {
* // Value: Number("long"),
* // TableArn: "STRING_VALUE",
* // },
* // },
* // QueryTableCount: Number("long"),
* // OutputRows: Number("long"),
* // OutputBytes: Number("long"),
* // },
* // ErrorReportLocation: {
* // S3ReportLocation: {
* // BucketName: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ExecuteScheduledQueryCommandOutput extends __MetadataBearer {}

/**
* <p> You can use this API to run a scheduled query manually. </p>
* <p>If you enabled <code>QueryInsights</code>, this API also returns insights and metrics related to the query that you executed as part of an Amazon SNS notification. <code>QueryInsights</code> helps with performance tuning of your query.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -40,6 +41,9 @@ export interface ExecuteScheduledQueryCommandOutput extends __MetadataBearer {}
* ScheduledQueryArn: "STRING_VALUE", // required
* InvocationTime: new Date("TIMESTAMP"), // required
* ClientToken: "STRING_VALUE",
* QueryInsights: { // ScheduledQueryInsights
* Mode: "ENABLED_WITH_RATE_CONTROL" || "DISABLED", // required
* },
* };
* const command = new ExecuteScheduledQueryCommand(input);
* const response = await client.send(command);
Expand Down
34 changes: 33 additions & 1 deletion clients/client-timestream-query/src/commands/QueryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
/**
* <p>
* <code>Query</code> is a synchronous operation that enables you to run a query against
* your Amazon Timestream data. <code>Query</code> will time out after 60 seconds.
* your Amazon Timestream data.</p>
* <p>If you enabled <code>QueryInsights</code>, this API also returns insights and metrics related to the query that you executed. <code>QueryInsights</code> helps with performance tuning of your query.</p>
* <note>
* <p>The maximum number of <code>Query</code> API requests you're allowed to make with <code>QueryInsights</code> enabled is 1 query per second (QPS). If you exceed this query rate, it might result in throttling.</p>
* </note>
* <p>
* <code>Query</code> will time out after 60 seconds.
* You must update the default timeout in the SDK to support a timeout of 60 seconds. See
* the <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.run-query.html">code
* sample</a> for details. </p>
Expand Down Expand Up @@ -71,6 +77,9 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
* ClientToken: "STRING_VALUE",
* NextToken: "STRING_VALUE",
* MaxRows: Number("int"),
* QueryInsights: { // QueryInsights
* Mode: "ENABLED_WITH_RATE_CONTROL" || "DISABLED", // required
* },
* };
* const command = new QueryCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -136,6 +145,29 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
* // CumulativeBytesScanned: Number("long"),
* // CumulativeBytesMetered: Number("long"),
* // },
* // QueryInsightsResponse: { // QueryInsightsResponse
* // QuerySpatialCoverage: { // QuerySpatialCoverage
* // Max: { // QuerySpatialCoverageMax
* // Value: Number("double"),
* // TableArn: "STRING_VALUE",
* // PartitionKey: [ // PartitionKeyList
* // "STRING_VALUE",
* // ],
* // },
* // },
* // QueryTemporalRange: { // QueryTemporalRange
* // Max: { // QueryTemporalRangeMax
* // Value: Number("long"),
* // TableArn: "STRING_VALUE",
* // },
* // },
* // QueryTableCount: Number("long"),
* // OutputRows: Number("long"),
* // OutputBytes: Number("long"),
* // UnloadPartitionCount: Number("long"),
* // UnloadWrittenRows: Number("long"),
* // UnloadWrittenBytes: Number("long"),
* // },
* // };
*
* ```
Expand Down
Loading

0 comments on commit 2caa046

Please sign in to comment.