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

ASF GitHub Bot commented on DRILL-2330:
---------------------------------------

Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/529#discussion_r68411510
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java ---
    @@ -844,4 +844,37 @@ public void testStatisticalWindowFunctions() throws 
Exception {
             .build()
             .run();
       }
    +
    +  @Test // DRILL-2330
    +  public void testNestedAggregates() throws Exception {
    +
    +    final String query = "select sum(min(l_extendedprice))" +
    +            " over (partition by l_suppkey order by l_suppkey) as 
totprice" +
    +            " from cp.`tpch/lineitem.parquet` where l_suppkey <= 10 group 
by l_suppkey order by 1 desc";
    +
    +    // Validate the plan
    +    final String[] expectedPlan = {"Window.*partition \\{0\\} order by 
\\[0\\].*SUM\\(\\$1\\).*",
    +            ".*SelectionVectorRemover.*",
    --- End diff --
    
    Ideally the regex used in the plan validation should only test for specific 
plan nodes.  In this case, is it sufficient to check for Window and the 
Aggregate and ignore the rest ?


> Add support for nested aggregate expressions for window aggregates
> ------------------------------------------------------------------
>
>                 Key: DRILL-2330
>                 URL: https://issues.apache.org/jira/browse/DRILL-2330
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Query Planning & Optimization
>    Affects Versions: 0.8.0
>            Reporter: Abhishek Girish
>            Assignee: Gautam Kumar Parai
>             Fix For: Future
>
>         Attachments: drillbit.log
>
>
> Aggregate expressions currently cannot be nested. 
> *The following query fails to validate:*
> {code:sql}
> select avg(sum(i_item_sk)) from item;
> {code}
> Error:
> Query failed: SqlValidatorException: Aggregate expressions cannot be nested
> Log attached. 
> Reference: TPCDS queries (20, 63, 98, ...) fail to execute.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to