compassql
compassql copied to clipboard
Criteria for enumerating timeUnit
- [ ] We need good criteria for determine timeUnits that we should determine by default for a particular dataset
Blocked #95 -- need stats first
@RileyChang Basically, if a particular timeUnit gives cardinality distinct
of 1, then it is a bad timeUnit to enumerate (because you don't see variation of timeUnit
at all!) so we should prune it from the result list.
This should be a pretty simple encoding constraint that takes field
and timeUnit
into account.
(properties: [Property.FIELD, Property.TIMEUNIT], requireAllPropertiesSpecific: true
) and reads cardinality from the schema
and return false if a particular timeUnit has cardinality ≤ 1.
See src/constraint/encoding.ts
for example of other constraint. @felixcodes is pretty knowledgable about constraint, so he could help if you get confused.
Note we might rename requireAllPropertiesSpecific
-- see #130
- [ ] From #109, since
schema
can be optional, check if schema is defined, if not, return true. (Because we can't know if the spec violates the constraint, so let it pass. We only prune surely bad things.)