You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/02/19 18:21:00 UTC

[jira] [Comment Edited] (CALCITE-5507) HAVING alias fails for mixed usage of alias and aggregate function

    [ https://issues.apache.org/jira/browse/CALCITE-5507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690882#comment-17690882 ] 

Julian Hyde edited comment on CALCITE-5507 at 2/19/23 6:20 PM:
---------------------------------------------------------------

Fixed in [2d283945|https://github.com/apache/calcite/commit/2d2839458d20b083762b5ffffef1d0b9dba4ef73].

[~jiajunbernoulli] Thanks for your PR! And thanks [~nobigo][~ZouDan] for the review!




was (Author: libenchao):
Fixed via https://github.com/apache/calcite/commit/bc263a34ee156f4c951cf488bcc24b02fa6b7576

[~jiajunbernoulli] Thanks for your PR! And thanks [~nobigo][~ZouDan] for the review!



> HAVING alias fails for mixed usage of alias and aggregate function
> ------------------------------------------------------------------
>
>                 Key: CALCITE-5507
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5507
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Jiajun Xie
>            Assignee: Jiajun Xie
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.34.0
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> We know that calcite can support HAVING alias by setting SqlConformanceEnum.LENIENT
> {code:java}
> sql("select count(empno) as e from emp having e > 10")
>     .withConformance(lenient).ok(); {code}
> but when I add one aggregate function in HAVING clause, it will fail.
> {code:java}
> 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{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)