Julian Hyde created CALCITE-3369:
------------------------------------

             Summary: In LatticeSuggester, recommend lattices based on UNION 
queries
                 Key: CALCITE-3369
                 URL: https://issues.apache.org/jira/browse/CALCITE-3369
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


In LatticeSuggester, recommend lattices based on UNION, EXCEPT and INTERSECT 
queries. Currently such queries are ignored.

Given the query
{code:java}
select * from t1 join t2
union
select * from t2 join t3;{code}
suggester should generate the same lattice(s) as if it had been given two 
separate queries
{code:java}
select * from t1 join t2;
select * from t2 join t3; {code}
Which may be a single lattice t1 - t2 - t3, or might be two lattices t1 - t2, 
t2 - t3.

Same for EXCEPT (MINUS), INTERSECT, UNION ALL, etc.

If the set-op is internal, I'm not sure what to do, e.g.
{code:java}
select *
from sales
join (select * from good_product
      union
      select * from bad_product) using (product_id){code}
 



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

Reply via email to