compassql icon indicating copy to clipboard operation
compassql copied to clipboard

Criteria for enumerating timeUnit

Open kanitw opened this issue 8 years ago • 2 comments

  • [ ] We need good criteria for determine timeUnits that we should determine by default for a particular dataset

Blocked #95 -- need stats first

kanitw avatar Jun 01 '16 06:06 kanitw

@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

kanitw avatar Jul 13 '16 05:07 kanitw

  • [ ] 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.)

kanitw avatar Jul 13 '16 06:07 kanitw