Repository navigation
AdhocRequestValidator.validateMeasureGrain() vs workbench-guard adversarial grain #4
h472591847
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context
@Tom-Zafred (Biomed Systems) compared his adversarial cross-table grain validation (workbench-guard RFC-001) against our 40-line
validateMeasureGrain()and proposed we compare implementations.Our implementation (40 lines)
validateMeasureGrain()inAdhocRequestValidator.java(L233-L261): stops to_one → to_many fan-out at the compile-time gate. Rejects any metric query whose grain is finer than the join target table's declared cardinality.Pseudo-logic:
Defensive stance: we never disprove to_many. Only confirm to_one when INFORMATION_SCHEMA proves it. The validator trusts YAML cardinality declarations and skips detail→order (composite FK with expense_d_state) — adhocQueryBatch splits multi-hop joins instead.
What we'd love to compare
Also — Tom caught a real bug in our INFORMATION_SCHEMA SQL this morning (
SEQ_IN_INDEX = 1+HAVING COUNT(DISTINCT) = 1→ tautology for composite indexes). Fixed in commit 2fc8483 with the corrected GROUP BY +HAVING COUNT(*) = 1pattern.@Tom-Zafred — jumping into the ring whenever you're ready.
All reactions