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

Gabor Kaszab commented on IMPALA-2792:
--------------------------------------

Hive also support size() that is kind of identical to count(). We can implement 
both to keep compatibility between the two systems.

> Syntactic sugar for computing aggregates over nested collections.
> -----------------------------------------------------------------
>
>                 Key: IMPALA-2792
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2792
>             Project: IMPALA
>          Issue Type: New Feature
>          Components: Frontend
>    Affects Versions: Impala 2.3.0
>            Reporter: Alexander Behm
>            Priority: Major
>              Labels: complextype, nested_types, planner, ramp-up, usability
>
> For user convenience and SQL brevity, we should add syntax extensions to 
> concisely express aggregates over nested collections. Internally, we should 
> re-write the concise versions into the more verbose equivalent with a 
> correlated inline view.
> Example A:
> {code}
> New syntax:
> select count(c.orders) from customer c
> Internally rewrite to:
> select cnt from customer c, (select count(*) from c.orders) v
> {code}
> Example B:
> {code}
> New syntax:
> select avg(c.orders.items.price) from customer c
> Internally rewrite to:
> select a from customer c, (select avg(price) from c.orders.items) v
> {code}
> I suggest performing the rewrite inside StmtRewriter.java after rewriting all 
> subqueries from the WHERE clause.
> Similar syntactic improvements should be considered for analytic functions on 
> nested collections.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to