Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Support ANY, SOME, EVERY (also known as BOOL_OR, BOOL_AND) aggregate functions.
ANY, SOME is equivalent with bool_or. EVERY is equivalent with bool_and. Parser needs to be changed to support these aggregate functions.
https://blog.jooq.org/2014/12/18/a-true-sql-gem-you-didnt-know-yet-the-every-aggregate-function/
https://mysqlserverteam.com/using-the-aggregate-functions-any-some-every-with-mysql/
Note that if ANY or SOME aggregate function is placed on the right side of comparison operation and argument of this function is a subquery additional parentheses around aggregate function are required, otherwise it will be parsed as quantified comparison predicate.
Example:
ANY(NAME LIKE 'W%')
A = (ANY((SELECT B FROM T)))
Attachments
Issue Links
- depends upon
-
CALCITE-3815 Add missing SQL standard aggregate functions: EVERY, SOME, INTERSECTION
- Closed
- is depended upon by
-
CALCITE-4335 Aggregate functions for BigQuery
- Closed
- is duplicated by
-
CALCITE-3616 Add BOOL_AND Aggregate Function
- Closed
-
CALCITE-3617 Add BOOL_OR Aggregate Function
- Closed
- is related to
-
CALCITE-6441 Add BOOLAGG_AND, BOOLAGG_OR aggregate functions (enabled in Snowflake library)
- Resolved
- relates to
-
CALCITE-2770 Add bitwise aggregate functions BIT_AND, BIT_OR
- Closed
-
CALCITE-6220 Rewrite MIN/MAX(BOOLEAN) as BOOL_AND/BOOL_OR for Postgres, Redshift
- Closed
- links to