Request for Comments: Filter behavior on undefined values
Martin Mares
mj at ucw.cz
Tue Jan 9 18:42:23 CET 2018
Hello!
> Variants we thought about when an undefined attribute is to be read:
>
> 1 the filter fails with an error.
> 2 the value is set to default (zero or whatever) and then used
> 3 it is propagated as undefined until any comparison/match happens,
> then the comparison/match is always false
In the Sherlock Holmes search engine, we used a different solution,
which could be applicable to BIRD filters, too.
We added an undefined value to all types, including the boolean type.
This leads to trivial tri-state logic, which can be modelled in this way:
1=true, -1=false, 0=undefined; AND is MIN, OR is MAX. Arithmetic operators
with at least one undefined input yield undefined output. Relational
operators with at least one undefined input yield an undefined boolean.
Functions can handle undefined values as they wish.
This is similar in spirit with your variant 3, but in particular it
avoids the paradoxes with negations.
Martin
More information about the Bird-users
mailing list