Repository navigation
feat: parity batch 19 (SQL engines register functions at init; Timestream function reference and intervals; Athena Trino functions; Service Quotas usage and enforcement) - #2555
Conversation
…ithmetic, non-finite doubles, guarded constants Adds the documented functions the engine lacked (array set operations, zip, repeat, shuffle, base conversion, bit operations, skewness and regression aggregates, n-ary max_by and min_by, weighted percentiles, quantified comparisons, VALUES lists and more) and asserts the reference examples. Intervals add, subtract, scale and compare. NaN and Infinity come out of every producing expression consistently. A constant inside an untaken branch is no longer evaluated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
…fix; Timestream sequence and interval edge cases The SQLite driver iterates its function table without a lock when a connection opens, so one engine registering lazily while another opened a connection could end the process with a concurrent map fault. Athena, BigQuery and Timestream now register during package init. Timestream's remaining plain-named functions move under its prefix and calls are qualified before execution; a guard and a cross-engine test keep every engine's names apart. Zero-argument sequence and integral calls hung, extreme sequence bounds ran away, a negated year-month interval was zero and log10 was off by one ulp at exact powers of ten. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
…e-count quotas CloudWatch Logs, KMS, EventBridge, Step Functions, Route 53, ECR, Auto Scaling, EFS, Firehose, Cognito and the EC2 and VPC resource quotas report live usage. With --enforce-service-quotas the create operations whose API documents a limit error fail at the applied value. Every catalogued quota is classified, and a guard fails when a counted quota has no counter. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
…rsion, bit and statistical aggregates and more Trino functions Several of these resolved in Athena only because another engine had registered them under plain names in the shared function table. Athena now implements them itself. Names that are not Trino functions stay unregistered. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
…KMS grant limit in the key's Region, pin the refresh delay in the Auto Scaling test EC2 documents limit codes for subnets, internet gateways, security groups and their rules, route tables and vCPUs, so those quotas are enforced under the flag as well as counted. CreateGrant looked up its limit in the request's Region. The instance refresh test raced a fixed 100ms transition. The quota classification data is corrected where a name pattern misfiled entries. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
… none of the standalone-only ones Timestream runs on Athena's translator, which rewrote sequence, repeat, zip, skewness and other names to Athena's new implementations before Timestream could claim them, and exposed Athena-only functions to Timestream queries. The embedded entry point now takes the set of names the host owns and skips standalone-only functions. The Timestream parser no longer reads past the end of a truncated cast. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
|
Important Review skippedToo many files! This PR contains 142 files, which is 42 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.
|
There was a problem hiding this comment.
Devin Review found 3 potential issues.
8 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| if err := quotaReached( | ||
| limit, len(b.versionsByStateMachine.Get(smARN)), ErrServiceQuotaExceeded, "state machine versions", | ||
| ); err != nil { | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
🔴 Failed publish changes live workflow
At the version limit, PublishStateMachineVersion rejects an update with publish=true after updateStateMachineAction saves the new definition. Unqualified executions then run the new definition despite the failed update.
Learn more
updateStateMachineAction updates the live workflow and any supplied configurations before it calls the version publisher. The publisher creates an immutable snapshot of the workflow. When that publisher rejects the request at the version cap, the handler propagates the error without undoing the update.
Example: A workflow has reached its published-version limit. An update with publish=true replaces definition A with B. The caller receives ServiceQuotaExceededException and no new version, but an execution started without a version uses B.
Recommended fix: Resolve the version limit before acquiring the backend lock, then validate quota, update the workflow and publish the version in one locked backend operation. Add an SDK regression test that verifies both the definition and revision stay unchanged on quota failure.
Was this helpful? React with 👍 or 👎 to provide feedback.
| func (b *InMemoryBackend) spotVCPUsLocked(class string) int { | ||
| n := 0 | ||
|
|
||
| for _, r := range b.spotRequests.All() { | ||
| if (r.State == stateActive || r.State == "open") && vcpuClass(r.LaunchSpec.InstanceType) == class { | ||
| n += b.typeVCPUs(r.LaunchSpec.InstanceType) | ||
| } |
There was a problem hiding this comment.
🔴 Running Spot instances lose quota charges
After CancelSpotInstanceRequests, spotVCPUsLocked stops counting the fulfilled request even though its instance keeps running. EC2 then accepts new Spot requests beyond the vCPU cap.
Learn more
RequestSpotInstances creates a running instance and stores its ID on the Spot request. CancelSpotInstanceRequests cancels the request without terminating that instance. The quota covers both requested and running capacity, but the counter drops the charge as soon as the request changes state. The Spot request sweeper later removes the request record, so retaining that record alone cannot track instance lifecycle reliably.
Example: With a five-vCPU Standard Spot cap, request two t3.micro instances for four vCPUs. Cancel both fulfilled requests and request two more. All four instances run, but the second request passes the cap check.
Recommended fix: Persist Spot lifecycle identity on the instance. Count each running or pending in-scope Spot instance once, plus outstanding requests without a live backing instance. Exclude Spot instances from On-Demand usage even after their requests expire.
Was this helpful? React with 👍 or 👎 to provide feedback.
| // rewriteCompare routes DOUBLE comparisons that may see NaN through functions where NaN is unordered. | ||
| func (inf *inferrer) rewriteCompare(n *node, a, b tsType) { | ||
| fn, ok := compareFuncName(n.name) | ||
| if !ok || n.kind != nBinary || !a.isNumeric() || !b.isNumeric() || !hasNonFiniteSource(n) { | ||
| return | ||
| } | ||
|
|
||
| inf.checkedEdit(fn+"(", n.start, n.start) | ||
| inf.checkedEdit(",", n.opStart, n.opEnd) | ||
| inf.checkedClose(")", n.end) |
There was a problem hiding this comment.
🔴 False matches in BIGINT comparisons
After integer division or modulo, rewriteCompare sends BIGINT comparisons through floatCompare. Distinct values above 2⁵³ can round to the same number, so filters match rows they must exclude.
| // rewriteCompare routes DOUBLE comparisons that may see NaN through functions where NaN is unordered. | |
| func (inf *inferrer) rewriteCompare(n *node, a, b tsType) { | |
| fn, ok := compareFuncName(n.name) | |
| if !ok || n.kind != nBinary || !a.isNumeric() || !b.isNumeric() || !hasNonFiniteSource(n) { | |
| return | |
| } | |
| inf.checkedEdit(fn+"(", n.start, n.start) | |
| inf.checkedEdit(",", n.opStart, n.opEnd) | |
| inf.checkedClose(")", n.end) | |
| // rewriteCompare routes DOUBLE comparisons that may see NaN through functions where NaN is unordered. | |
| func (inf *inferrer) rewriteCompare(n *node, a, b tsType) { | |
| fn, ok := compareFuncName(n.name) | |
| if !ok || n.kind != nBinary || !a.isNumeric() || !b.isNumeric() || | |
| (a.kind != tyDouble && b.kind != tyDouble) || !hasNonFiniteSource(n) { | |
| return | |
| } | |
| inf.checkedEdit(fn+"(", n.start, n.start) | |
| inf.checkedEdit(",", n.opStart, n.opEnd) | |
| inf.checkedClose(")", n.end) |
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📊 Code Coverage Report
📄 Impacted Files Breakdown
Tip This project maintains a minimum coverage threshold of 85%. Maintain or improve coverage on new code to ensure long-term stability. Last updated: Sun, 22 Nov 2026 07:02:39 GMT |
Summary
One crash fix that affects every SQL engine, plus three feature changes. Each feature commit was followed by an independent review pass, except the Athena functions, which were written test-first and are covered by the gate.
Fix: SQL engines register their functions at init
Timestream Query: the documented function reference
zip,repeat,shuffle, base conversion, bit operations, skewness and regression aggregates, n-arymax_byandmin_by, weighted percentiles, quantified comparisons,VALUESlists and more. 87 reference examples are asserted.Athena: Trino functions it was borrowing
sequence,repeat,zip, array set operations, base conversion, bit and statistical aggregates and about 15 more are implemented in Athena itself. Several resolved before only because another engine had registered them under plain names.Behaviour to be aware of:
from_milliseconds,from_nanoseconds,to_nanoseconds,nanosecondandstrrposno longer resolve in Athena. They are not Trino functions and worked only through the shared function table.Service Quotas: usage and opt-in enforcement
--enforce-service-quotas, create operations whose API documents a limit error fail at the applied value, including the EC2 limit codes for subnets, internet gateways, security groups and their rules, route tables and vCPUs. Behaviour with the flag off is unchanged.Still open in the touched services
Service Quotas 2: 61 of about 3,300 resource-count quotas have counters, and rate quotas never throttle. Timestream Query 6. Athena: about 60 further Trino functions are now listed as missing.
Test plan
go build ./...,go vet ./...(pluse2e,integrationandterraformtags),go fix -diffempty./test/crossengine/...and./dashboard/...with-race -shuffle on -short./internal/appwith-race -shuffle on -short, leak suitegolangci-linton touched packages,./internal/app/...,./dashboard/...,./test/guards/...desktopmodule tidy and build🤖 Generated with Claude Code
https://claude.ai/code/session_01NVwMjLknMM32Xje6Qik6wY