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

HAVING alias fails for mixed usage of alias and aggregate function

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.34.0
    • None

    Description

      We know that calcite can support HAVING alias by setting SqlConformanceEnum.LENIENT

      sql("select count(empno) as e from emp having e > 10")
          .withConformance(lenient).ok(); 

      but when I add one aggregate function in HAVING clause, it will fail.

      sql("select count(empno) as e from emp having ^e^ > 10 and count(empno) > 10 ")
          .withConformance(lenient).fails("Column 'E' not found in any table"); 
      // I think it should be ok

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jiajunbernoulli Jiajun Xie
            jiajunbernoulli Jiajun Xie
            Votes:
            0 Vote for this issue
            Watchers:
            5 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

                Slack

                  Issue deployment