Shant Hovsepian created IMPALA-9796:
---------------------------------------

             Summary: Support Subquery Coalescing / Subsumption / Merge
                 Key: IMPALA-9796
                 URL: https://issues.apache.org/jira/browse/IMPALA-9796
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
            Reporter: Shant Hovsepian


The idea tends to go by names each with their own subtle meaning. However in 
general given multiple subqueries in a single query it may be possible to 
combine them into a single subquery.

 
{code:java}
SELECT A.agg1, B.agg2 FROM (SELECT sum(price) as agg1 FROM T1) A, (SELECT 
avg(price) as agg2 FROM T1) B;   {code}
The above could be combined to calculate both aggregates in one pass.
{code:java}
SELECT C.agg1, C.agg2 FROM (SELECT sum(price) as agg1, avg(price) as agg2 FROM 
T1) C;{code}
 

More complex subquery examples are possible where predicates disjunctive 
predicates can be combined.



--
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