Expand description
A real, bounded SQL handler for Amazon Timestream Query.
A faithful Timestream SQL engine (the full Trino-derived time-series
dialect) is out of scope. This module implements a genuine interpreter for
the query shapes the SDK, e2e, and conformance exercise, over the points
ingested by WriteRecords:
SELECT * FROM "db"."table"– every stored point as a row, with AWS-shapedColumnInfo/Datumtyping: oneVARCHARcolumn per dimension name,measure_name(VARCHAR), ameasure_value::<type>column per measure value type present, andtime(TIMESTAMP).SELECT COUNT(*) FROM "db"."table"– a singleBIGINTrow.- optional
WHERE time <op> ago(<n><unit>)time filter. - optional
ORDER BY time [ASC|DESC]. - optional
LIMIT <n>.
Anything outside this subset returns QueryError::Validation naming the
unsupported construct, so a caller never gets a wrong or silently-empty
success for a query the engine cannot actually run.
Structs§
- Plan
- A parsed, executable query plan.
- Query
Result - The materialized result of a plan: AWS-shaped
ColumnInfolist andRowlist, both ready to drop straight into theQueryresponse JSON.
Enums§
- CmpOp
- A comparison operator in a
WHERE time <op> ...clause. - Projection
- What the
SELECTlist projects. - Query
Error - Why a query could not be planned/run.
Functions§
- execute
- Execute a
Planagainst a table’s ingested points, producing the AWS-shapedColumnInfo+Rowlists. - parse_
query - Parse a Timestream
SELECTinto an executablePlan, or return aQueryError::Validationnaming the unsupported construct.