heavyai / heavyai-crossfilter

JavaScript library for exploring large multivariate datasets in the browser.
Other
51 stars 20 forks source link

Add OR _ IS NULL when adding non-null inverse equality filters, to avoid filtering nulls out too #104

Closed jonvuri closed 4 years ago

jonvuri commented 4 years ago

This adds OR col IS NULL when an inverse exact filter (like NOT (col = 'value')) is added to a dimension. This is meant to make the behavior more intuitive and 'correct' to users who probably don't expect the SQL behavior of not including nulls when an inverse equality filter is acting on a non-null value.

Before this change: NOT (color = 'cerulean')

puce            puce
ochre     ->    ochre
cerulean        fuchsia
fuchsia
NULL

After this change: NOT (color = 'cerulean') OR color IS NULL

puce            puce
ochre     ->    ochre
cerulean        fuchsia
fuchsia         NULL
NULL