Skip to content

Logical / Boolean Aggregation Functions #1011

@gramian

Description

@gramian

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions