-
-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Discussed in #854
Originally posted by gramian February 12, 2023
PostgreSQL and data.world (and others) have some very interesting boolean aggregation functions, BOOL_AND and BOOL_OR, which aggregate columns (here properties) based on a boolean expression (optionally into groups). While one can probably emulate these function with nested queries and counts, the appeal of these function would be their performant short-circuit implementation, meaning AND returns false as soon as the first false (in a group) is found, and OR returns true as soon as the first true (in a group) is found.
I would like to propose adding these two boolean aggregators, as they should be really useful for data cleaning or data exploration, answering questions like "Are all of ..." or "Are any of ..." fast. Thus, they also fit well with the Play With Data motto. Lastly, these functions are different to filtering with all() and any() due to different scope (property vs document) and are (only in purpose) similar to SQL's ALL and ANY.