Reject unsupported query operators during execution planning

This commit is contained in:
Timothy J. Aveni
2026-09-20 23:58:07 -07:00
parent 47a3fe9eae
commit 08e322e59f
4 changed files with 132 additions and 0 deletions
+12
View File
@@ -108,3 +108,15 @@ test("typed reference operands and scalar membership tests reject unbounded lite
/1000 operands/,
);
});
test("new runtime operator matrix accepts direct count and rejects unsupported relational plans", async () => {
const { unsupportedQueryOperator } = await import("../src/execution-world/query-operators.js");
assert.equal(unsupportedQueryOperator(await compile("aggregate { count }")), undefined);
for (const expression of [
"aggregate { sum { estimatedHours } }",
"filter(where: {estimatedHours: {gt: 0}}) { aggregate { count } }",
"distinct(by: {estimatedHours: true}) { aggregate { count } }",
"aggregate { count @skip(if: true) }",
])
assert.ok(unsupportedQueryOperator(await compile(expression)), expression);
});