fix(driver-memory): accept the engine QueryAST in aggregate() (analytics fallback)#1703
Merged
Merged
Conversation
…ics fallback)
ObjectQL's engine calls driver.aggregate(object, AST) with the same
{ where, groupBy, aggregations } shape find() consumes — but the in-memory
driver's aggregate() only understood MongoDB pipeline arrays, so the
analytics RAW_SQL_UNSUPPORTED fallback (framework#1701) crashed with
"this[#pipeline].map is not a function" on in-memory environments — the
last broken link in dataset queries on staging tenants.
aggregate() now detects the AST shape and serves it through the SAME
where-filter + performAggregation path find() uses (count/sum/avg/min/max,
multi-field groupBy, aliases); a real pipeline array keeps the Mingo
behavior unchanged.
driver-memory: 68 tests green (3 new: grouped sums via AST, where+no-groupBy
single-row totals, pipeline-array passthrough).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the staging "No rows" fix chain (framework#1701 was layer 1).
After #1701, dataset queries on in-memory environments correctly fall back from NativeSQL to the aggregate strategy — which then crashed with
this[#pipeline].map is not a function:ObjectQL.aggregatehands drivers the QueryAST ({where, groupBy, aggregations}), butInMemoryDriver.aggregate()only understood MongoDB pipeline arrays (Mingo).aggregate()now detects the AST shape and serves it through the same where-filter +performAggregationpathfind()already uses (the shapes match exactly —{function, field, alias}); real pipeline arrays keep the Mingo passthrough unchanged.Test: driver-memory 68 green — new: grouped sums via AST;
where+ no-groupBy single-row totals; pipeline-array passthrough.Staging validation: bump cloud
.framework-shaafter merge → the expense Spending Dashboard should finally render real numbers.🤖 Generated with Claude Code