Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow including null fields in filter query with addition of a new query param flag #1012

Open
corneliusroemer opened this issue Nov 25, 2024 · 0 comments

Comments

@corneliusroemer
Copy link
Contributor

In Loculus we'll soon have dates represented as ranges instead of points. Some sequences might lack dates entirely. In that case we will likely not provide a lower range, as any lower range could be too high (one could set it to something arbitrarily really small but that's somehow unpleasant). So null actually means -infinity in that case.

There's an interesting use case that seems currently impossible to implement with LAPIS as is:

One might want to filter for all sequences that could have been collected before 1980. This is simple to express: the lower range should be smaller than 1980. Null in the lower range field should be interpreted as -infinity. And -infinity is of course smaller than 1980. So any nulls should be included in the result.

However, if I understand LAPIS correctly, one can't actually perform this search right now. Nulls will always be missing on all range queries.

Would it be possible to work around this somehow with a new feature? Something to add nulls back in? This might be the most generic way to implement something that would allow the above use case to work.

You'd simply add a new special boolean fieldNameIncludeNulls that is interpreted as an OR together with other filters on the same field. So if fieldName>5 is set and fieldNameIncludeNulls=true then all entries matching one or the other would be included.

Maybe I'm missing something and this is already possible, otherwise this could be a neat addition to broaden the expressive pwoer of LAPIS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant