Dongjoon Hyun created TAJO-1406:
-----------------------------------

             Summary: Support WITH clause without RECURSIVE
                 Key: TAJO-1406
                 URL: https://issues.apache.org/jira/browse/TAJO-1406
             Project: Tajo
          Issue Type: Bug
          Components: parser, planner/optimizer
            Reporter: Dongjoon Hyun


WITH clause is widely used expression in SQL language, for e.g., TPC-DS Q1, Q2, 
Q4, Q5, Q11, Q14, Q23, Q24, Q30, Q31, Q33, Q39, Q47, Q51, Q54, Q56, Q57, Q58, 
Q59, Q60, Q64, Q74, Q75, Q77, Q78, Q80, Q81, Q83, Q95, Q97.

Refer the following queries in 
http://www.postgresql.org/docs/9.4/static/queries-with.html.

{code:sql}
WITH regional_sales AS (
        SELECT region, SUM(amount) AS total_sales
        FROM orders
        GROUP BY region
     ), top_regions AS (
        SELECT region
        FROM regional_sales
        WHERE total_sales > (SELECT SUM(total_sales)/10 FROM regional_sales)
     )
SELECT region,
       product,
       SUM(quantity) AS product_units,
       SUM(amount) AS product_sales
FROM orders
WHERE region IN (SELECT region FROM top_regions)
GROUP BY region, product;
{code}

In this issue, WITH RECURSIVE does not support. It should be handled as a 
separate issue.



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

Reply via email to