Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2935

Add BOOL_OR, BOOL_AND, LOGICAL_OR, LOGICAL_AND aggregate functions

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.27.0
    • Component/s: core

      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

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                hyuan Haisheng Yuan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3.5h
                  3.5h