Skip to content

Timestream Query ​

Parity grade: A · SDK aws-sdk-go-v2/service/timestreamquery@v1.44.3 · last audited 2026-11-05 (a98a164d)

Category: Database · View PARITY.md on GitHub · All Services

Parity & Coverage ​

MetricValue
PARITY entries audited12 (12 ok)
Feature families2 (1 ok, 1 deferred)
Known gaps8
Structural gaps (can't be emulated)1
Deferred items0
Resource leaksclean

Known Gaps ​

  • Static type inference (ts_infer.go) types every select-list expression before execution; a query it cannot parse or type keeps the older value-based column typing (and syntactic boolean/interval typing, ts_boolean.go), an empty result of such a column reports VARCHAR, and the checked arithmetic and casts below do not apply to it (SQLite semantics: integer overflow widens, CAST(double AS bigint) truncates, TRY_CAST of an unparsable string yields 0, division by zero yields NULL). Remaining sites: positional ? markers (PrepareQuery reports them as param1.. VARCHAR; the PrepareQuery page documents only @identifier names); an @name in the select list or compared with another untyped operand (its type depends on a value no request supplies; PrepareQuery reports VARCHAR); lambdas outside filter, transform, reduce, zip_with, the *_match functions and the regexp_replace lambda; transform() over a timeseries (the engine has no implementation); map-typed functions (map, map_agg, map_keys, map_values, histogram); a row field name that does not exist and row[i] with a non-literal i; any function without a return-type rule (SQLite built-ins outside the Timestream function list)
  • Unverified against the service: integer literals are typed INTEGER when they fit 32 bits else BIGINT (supported-data-types.html lists int and bigint but not which a literal gets; the SDK ScalarType enum has INTEGER, appended after UNKNOWN, and string-functions.html lists codepoint as integer, so the service emits it for something, but no recorded real response in the repo or the documentation shows a literal's ColumnInfo), and typeof() prints array(T), row(name T, ...) and timeseries(T) for nested types (array-functions.html writes output types as array(bigint), array(varchar), array(timestamp) and array(row), which is notation for function signatures, not typeof output; no page shows typeof of a row or timeseries)
  • Checked arithmetic and casts: the error type (ValidationException) and message wording ("bigint addition overflow: A + B", "Division by zero", "Cannot cast 'x' to BIGINT", "Out of range for integer: N", "Value cannot be cast to timestamp: x") follow the Presto/Trino family from memory; no Timestream page quotes them. CAST(double AS bigint) rounds half away from zero on the same basis. try() maps a failure anywhere inside its argument to NULL for the failing operation, which differs from the family only when a NULL changes a surrounding coalesce or CASE
  • Documented functions: every function on the Timestream mathematical, string, array, bitwise, regular expression, date/time, aggregate, window, conditional, comparison and time series pages is implemented except one example: parse_datetime with a zone-abbreviation pattern (date-time-functions.html: parse_datetime('2019-12-29 10:10 PST', 'uuuu-LL-dd HH:mm z') returns 2019-12-29 18:10:00.000000000) fails with 'Invalid format' because the base engine's parser has no zone abbreviations. max(x, n), min(x, n) and approx_percentile(x, ARRAY[...]) are not usable as window functions (they raise a clear error); the aggregates added in the reference function pass are. Argument bounds and error wording come from the engine family, not a Timestream page, for: max(x, n)/min(x, n) n 1-10000, max_by/min_by(x, y, n) n 1-10000 ('third argument of max_by must be a positive integer'), approx_percentile percentage range 0-1 and weight/accuracy checks, approx_distinct(x, e) with e in [0.0040625, 0.26] (the e range itself is on aggregate-functions.html), repeat count 0-10000, zip of 2 to 5 arrays, from_base/to_base radix 2-36, strpos/strrpos with overlapping matches and 'instance' must be a positive number, strpos/strrpos(x, '') = 1, skewness and the regr_* functions returning NULL for fewer than 3 rows or no variance in x, replace(x, '', y) inserting y between characters
  • NaN has no SQLite representation (a NaN stored in a REAL column becomes NULL), so a NaN DOUBLE is the text 'NaN' only where it is rendered (a top-level select item with no CTE), under a CAST to anything but DOUBLE, as the argument of is_nan/is_finite/is_infinite, or as an operand of DOUBLE arithmetic or comparison that is itself rewritten (an operand subtree containing nan(), infinity(), a division, a modulo, a CAST/typed literal to DOUBLE, or sqrt/ln/log10/log2/acos/asin/acosh/atanh/power/pow); there nan(), CAST('NaN' AS double), 0e0/0e0, sqrt(-1), ln(-1), infinity() - infinity() and nan() + 1 give NaN, ln(0) gives -Infinity, nan() = nan() is false and nan() <> nan() is true. Everywhere else a NaN is NULL: a NaN passed through a subquery or CTE column, ORDER BY, GROUP BY, DISTINCT, an aggregate (sum, min, max, avg over a NaN is not NaN), a window function, sign(), abs(), round() and similar numeric functions, or arithmetic whose operands the rewrite cannot see (a column holding a NaN, which the engine cannot store). NaN ordering (last, greatest) therefore does not hold. Infinity and -Infinity are real doubles and behave normally; a DOUBLE function rewritten for NaN is a Go function, not the native SQLite one, so its last digit can differ from SQLite's libm
  • Unverified against the service: the argument bounds and error wording of the reference functions come from the Presto/Trino family because no Timestream page states them: repeat count 0..10000, max_by/min_by n 1..10000, sequence() at most 1,000,000 elements (the family caps at 10,000), zip 2..5 arrays, from_base/to_base radix 2..36, bit_count bits 2..64, approx_distinct error 0.0040625..0.26, lpad/rpad length at most 16,777,216
  • INTERVAL YEAR TO MONTH arithmetic lives in the shared SQL engine (services/athena engine_interval.go) and does not range-check: 1year * 9223372036854775807 wraps instead of failing, and TIMESTAMP + 9999999999999year renders a year far beyond 9999
  • A checked arithmetic or cast rewrite that fails to translate or prepare (anything but a checked function rejecting a value) reruns the query without the checked rewrites, so such a query keeps the older semantics (overflow widens, division by zero is NULL, casts truncate) instead of failing

Structural Gaps ​

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • CreateScheduledQuery KmsKeyId is stored and echoed, but there is no at-rest encryption layer to apply it to.

Audited Operations ​

12 audited operations
OperationWireErrorsStatePersist
Queryfixedokfixedok
CancelQueryokokfixedok
PrepareQueryokokfixedn/a
DescribeEndpointsokokokn/a
CreateScheduledQueryfixedokfixedok
DeleteScheduledQueryokokfixedok
DescribeScheduledQueryfixedokokok
ExecuteScheduledQueryokokfixedok
ListScheduledQueriesokokokok
UpdateScheduledQueryokokfixedok
DescribeAccountSettingsfixedokokok
UpdateAccountSettingsfixedfixedfixedfixed

Audited Feature Families ​

Feature FamilyStatus
tagsdeferred
route_matchingok

Released under the MIT License.