@hypequery/protocol-conformance 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,5 +9,6 @@
9
9
  {"id": "window-and-shift-measures", "value": {"kind": "hypequery-deployment", "version": 3, "datasets": [{"name": "orders", "source": "orders", "tenant": {"kind": "not-required"}, "dimensions": [{"name": "tier", "type": "string", "source": {"kind": "column", "column": "tier"}, "filterable": true, "groupable": true}, {"name": "status", "type": "string", "source": {"kind": "column", "column": "status"}, "filterable": true, "groupable": true}, {"name": "amount", "type": "number", "source": {"kind": "column", "column": "amount"}, "filterable": true, "groupable": true}, {"name": "createdAt", "type": "timestamp", "source": {"kind": "column", "column": "created_at"}, "filterable": true, "groupable": true}], "measures": [{"name": "revenue", "aggregation": "sum", "field": "amount", "filters": []}, {"kind": "window", "requiresTimeRange": true, "name": "revenue7d", "measure": "revenue", "trailing": {"amount": 7, "unit": "day"}}, {"kind": "window", "requiresTimeRange": true, "name": "revenueMtd", "measure": "revenue", "toDate": "month"}, {"kind": "window", "requiresTimeRange": true, "name": "revenueRunning", "measure": "revenue", "cumulative": true}, {"kind": "shift", "requiresTimeRange": true, "name": "revenuePriorYear", "measure": "revenue", "interval": {"amount": 1, "unit": "year"}}, {"kind": "derived", "name": "revenueGrowth", "uses": [{"alias": "now", "measure": "revenue"}, {"alias": "before", "measure": "revenuePriorYear"}], "expression": {"kind": "binary", "operator": "divide", "left": {"kind": "binary", "operator": "subtract", "left": {"kind": "reference", "name": "now"}, "right": {"kind": "reference", "name": "before"}}, "right": {"kind": "call", "function": "nullIfZero", "args": [{"kind": "reference", "name": "before"}]}}}], "allowedFilters": [{"name": "status", "field": "status", "operators": ["eq", "in"]}], "segments": [], "relationships": [], "timeField": "created_at"}]}},
10
10
  {"id": "approximate-window", "value": {"kind": "hypequery-deployment", "version": 3, "datasets": [{"name": "orders", "source": "orders", "tenant": {"kind": "not-required"}, "dimensions": [{"name": "tier", "type": "string", "source": {"kind": "column", "column": "tier"}, "filterable": true, "groupable": true}, {"name": "status", "type": "string", "source": {"kind": "column", "column": "status"}, "filterable": true, "groupable": true}, {"name": "amount", "type": "number", "source": {"kind": "column", "column": "amount"}, "filterable": true, "groupable": true}, {"name": "createdAt", "type": "timestamp", "source": {"kind": "column", "column": "created_at"}, "filterable": true, "groupable": true}], "measures": [{"name": "activeUsers", "aggregation": "approxCountDistinct", "field": "user_id", "filters": [], "approximate": true}, {"kind": "window", "requiresTimeRange": true, "name": "activeUsers7d", "measure": "activeUsers", "trailing": {"amount": 7, "unit": "day"}, "approximate": true}, {"kind": "shift", "requiresTimeRange": true, "name": "activeUsersLastWeek", "measure": "activeUsers", "interval": {"amount": 1, "unit": "week"}, "approximate": true}], "allowedFilters": [{"name": "status", "field": "status", "operators": ["eq", "in"]}], "segments": [], "relationships": [], "timeField": "created_at"}]}},
11
11
  {"id":"approx-count-distinct-without-segments","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"orders","source":"orders","tenant":{"kind":"not-required"},"dimensions":[{"name":"tier","type":"string","source":{"kind":"column","column":"tier"},"filterable":true,"groupable":true},{"name":"status","type":"string","source":{"kind":"column","column":"status"},"filterable":true,"groupable":true},{"name":"amount","type":"number","source":{"kind":"column","column":"amount"},"filterable":true,"groupable":true},{"name":"createdAt","type":"timestamp","source":{"kind":"column","column":"created_at"},"filterable":true,"groupable":true}],"measures":[{"name":"activeUsers","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true},{"name":"approxActiveFiltered","aggregation":"approxCountDistinct","field":"user_id","filters":[{"kind":"comparison","operator":"eq","left":{"kind":"reference","name":"status"},"right":{"kind":"literal","value":"paid"}}],"approximate":true}],"allowedFilters":[{"name":"status","field":"status","operators":["eq","in"]}],"relationships":[]}]}},
12
- {"id":"merge-measures","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"daily_active_users","source":"daily_active_users","tenant":{"kind":"not-required"},"dimensions":[{"name":"day","type":"timestamp","source":{"kind":"column","column":"day"},"filterable":true,"groupable":true}],"measures":[{"name":"active_users","aggregation":"merge","field":"users","filters":[],"stateFunction":"uniq","approximate":true},{"name":"exact_users","aggregation":"merge","stateFunction":"uniqExact","field":"users","filters":[]},{"name":"approx_users","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true}],"allowedFilters":[],"relationships":[]}]}}
12
+ {"id":"merge-measures","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"daily_active_users","source":"daily_active_users","tenant":{"kind":"not-required"},"dimensions":[{"name":"day","type":"timestamp","source":{"kind":"column","column":"day"},"filterable":true,"groupable":true}],"measures":[{"name":"active_users","aggregation":"merge","field":"users","filters":[],"stateFunction":"uniq","approximate":true},{"name":"exact_users","aggregation":"merge","stateFunction":"uniqExact","field":"users","filters":[]},{"name":"approx_users","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true}],"allowedFilters":[],"relationships":[]}]}},
13
+ {"id":"null-checks","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"customers","source":"customers","tenant":{"kind":"not-required"},"dimensions":[{"name":"plan","type":"string","source":{"kind":"column","column":"plan"},"filterable":true,"groupable":true},{"name":"churnedAt","type":"timestamp","source":{"kind":"column","column":"churned_at"},"filterable":true,"groupable":true},{"name":"trial","type":"boolean","source":{"kind":"column","column":"trial"},"filterable":true,"groupable":true}],"measures":[{"name":"churnedCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churned_at"}}]},{"name":"activeCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNull","left":{"kind":"reference","name":"churned_at"}},{"kind":"comparison","operator":"eq","left":{"kind":"reference","name":"trial"},"right":{"kind":"literal","value":false}}]}],"allowedFilters":[{"name":"churnedAt","field":"churnedAt","operators":["gte","isNotNull","isNull"]},{"name":"trial","field":"trial","operators":["eq","isNull"]}],"segments":[{"name":"churned","predicate":{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churnedAt"}}}],"relationships":[]}]}}
13
14
  ]
@@ -12,3 +12,5 @@ Generators have these language-neutral meanings:
12
12
  - `logical-operands` creates one logical `and` node containing `count` distinct copies of that literal expression.
13
13
  - `logical-tree` creates a logical `and` root with ten logical `and` groups. The first nine groups contain 100 distinct literal expressions and the tenth contains `lastGroupItems`. The resulting expression has exactly `911 + lastGroupItems` nodes.
14
14
  - `unsafe-accessor` is host-model conditional under RFC 0012 and exposes a reference's `name` through an accessor rather than a data property.
15
+
16
+ RFC 0023 added the null checks: the `comparison-isNull`, `comparison-isNotNull` and `null-check-*` success cases and the `dataset-null-check-filters` query, and rejections for a null check with a `right` operand (including a `null` literal), one without `left`, and a value comparison without `right`.
@@ -22,5 +22,12 @@
22
22
  { "id": "expression-too-deep", "mode": "expression", "generator": { "type": "nested-not", "depth": 16 }, "error": "HQ_EXPRESSION_TOO_DEEP" },
23
23
  { "id": "expression-too-many-nodes", "mode": "expression", "generator": { "type": "logical-tree", "lastGroupItems": 90 }, "error": "HQ_EXPRESSION_TOO_MANY_NODES" },
24
24
  { "id": "expression-too-many-items", "mode": "expression", "generator": { "type": "logical-operands", "count": 101 }, "error": "HQ_EXPRESSION_TOO_MANY_ITEMS" },
25
- { "id": "expression-unsafe-accessor", "mode": "expression", "generator": { "type": "unsafe-accessor" }, "error": "HQ_EXPRESSION_UNSAFE_OBJECT" }
25
+ { "id": "expression-unsafe-accessor", "mode": "expression", "generator": { "type": "unsafe-accessor" }, "error": "HQ_EXPRESSION_UNSAFE_OBJECT" },
26
+ { "id": "comparison-isNull-with-right", "mode": "expression", "value": { "kind": "comparison", "operator": "isNull", "left": { "kind": "reference", "name": "churned_at" }, "right": { "kind": "literal", "value": null } }, "error": "HQ_EXPRESSION_INVALID_ARITY" },
27
+ { "id": "comparison-isNotNull-with-value", "mode": "expression", "value": { "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "churned_at" }, "right": { "kind": "literal", "value": "1971-01-01" } }, "error": "HQ_EXPRESSION_INVALID_ARITY" },
28
+ { "id": "comparison-isNull-without-left", "mode": "expression", "value": { "kind": "comparison", "operator": "isNull" }, "error": "HQ_EXPRESSION_TYPE" },
29
+ { "id": "comparison-eq-without-right", "mode": "expression", "value": { "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" } }, "error": "HQ_EXPRESSION_TYPE" },
30
+ { "id": "comparison-unknown-null-operator", "mode": "expression", "value": { "kind": "comparison", "operator": "isEmpty", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "" } }, "error": "HQ_EXPRESSION_INVALID_OPERATOR" },
31
+ { "id": "aggregate-filter-isNotNull-with-right", "mode": "expression", "value": { "kind": "aggregate", "aggregation": "count", "field": "id", "filters": [{ "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "churned_at" }, "right": { "kind": "literal", "value": "1971-01-01" } }] }, "error": "HQ_EXPRESSION_INVALID_ARITY" },
32
+ { "id": "query-filter-isNull-with-right", "mode": "query", "value": { "kind": "dataset", "dataset": "customers", "filters": [{ "kind": "comparison", "operator": "isNull", "left": { "kind": "reference", "name": "churned_at" }, "right": { "kind": "literal", "value": null } }] }, "error": "HQ_EXPRESSION_INVALID_ARITY" }
26
33
  ]
@@ -40,7 +40,13 @@
40
40
  { "id": "aggregate-variance", "value": { "kind": "aggregate", "aggregation": "variance", "field": "amount" } },
41
41
  { "id": "limit-depth-16", "generator": { "type": "nested-not", "depth": 15 } },
42
42
  { "id": "limit-nodes-1000", "generator": { "type": "logical-tree", "lastGroupItems": 89 } },
43
- { "id": "limit-items-100", "generator": { "type": "logical-operands", "count": 100 } }
43
+ { "id": "limit-items-100", "generator": { "type": "logical-operands", "count": 100 } },
44
+ { "id": "comparison-isNull", "value": { "kind": "comparison", "operator": "isNull", "left": { "kind": "reference", "name": "churned_at" } } },
45
+ { "id": "comparison-isNotNull", "value": { "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "churned_at" } } },
46
+ { "id": "null-check-qualified-boolean", "value": { "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "customer.active" } } },
47
+ { "id": "null-check-call-operand", "value": { "kind": "comparison", "operator": "isNull", "left": { "kind": "call", "function": "nullIfZero", "args": [{ "kind": "reference", "name": "seats" }] } } },
48
+ { "id": "null-check-negated", "value": { "kind": "logical", "operator": "not", "operand": { "kind": "comparison", "operator": "isNull", "left": { "kind": "reference", "name": "churned_at" } } } },
49
+ { "id": "null-check-aggregate-filter", "value": { "kind": "aggregate", "aggregation": "count", "field": "id", "filters": [{ "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "churned_at" } }] } }
44
50
  ],
45
51
  "queries": [
46
52
  { "id": "dataset-all-query-features", "value": { "kind": "dataset", "dataset": "orders", "dimensions": ["status", "customer.country"], "measures": ["revenue", "orders"], "filters": [{ "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } }], "orderBy": [{ "field": "customer.country", "direction": "asc" }, { "field": "revenue", "direction": "desc" }], "limit": 100, "offset": 0, "by": "quarter", "includeMeta": true } },
@@ -48,6 +54,7 @@
48
54
  { "id": "query-safe-integer-maximum", "value": { "kind": "dataset", "dataset": "orders", "limit": 9007199254740991, "offset": 9007199254740991 } },
49
55
  { "id": "grain-day", "value": { "kind": "dataset", "dataset": "orders", "by": "day" } },
50
56
  { "id": "grain-month", "value": { "kind": "dataset", "dataset": "orders", "by": "month" } },
51
- { "id": "grain-year", "value": { "kind": "dataset", "dataset": "orders", "by": "year", "limit": 0 } }
57
+ { "id": "grain-year", "value": { "kind": "dataset", "dataset": "orders", "by": "year", "limit": 0 } },
58
+ { "id": "dataset-null-check-filters", "value": { "kind": "dataset", "dataset": "customers", "measures": ["customers"], "filters": [{ "kind": "comparison", "operator": "isNotNull", "left": { "kind": "reference", "name": "churned_at" } }, { "kind": "logical", "operator": "or", "operands": [{ "kind": "comparison", "operator": "isNull", "left": { "kind": "reference", "name": "plan" } }, { "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "plan" }, "right": { "kind": "literal", "value": "free" } }] }] } }
52
59
  ]
53
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/protocol-conformance",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Cross-language conformance runner for the Hypequery analytics security protocol",
5
5
  "keywords": [
6
6
  "hypequery",
@@ -31,7 +31,7 @@
31
31
  "README.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@hypequery/protocol": "^0.23.0"
34
+ "@hypequery/protocol": "^0.24.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22.5.0",