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

Allow alias in having clause for aggregate functions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.19.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently alias is not allowed in having for aggregate functions.
      MySql supports such cases and taking into account that alias in having clause is allowed only for the following conformance levels: MYSQL_5, LENIENT, BABEL, it makes sense to allow alias in having for aggregate functions.

       /**
         * Whether to allow aliases from the {@code SELECT} clause to be used as
         * column names in the {@code HAVING} clause.
         *
         * <p>Among the built-in conformance levels, true in
         * {@link SqlConformanceEnum#BABEL},
         * {@link SqlConformanceEnum#LENIENT},
         * {@link SqlConformanceEnum#MYSQL_5};
         * false otherwise.
         */
        boolean isHavingAlias();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                arina Arina Ielchiieva
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: