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

Keuntae Park commented on TAJO-1406:
------------------------------------

I think one simple approach is to replace query name in the remaining query 
with query expression of WITH clause while alias name of the query expression 
as query name given in WITH clause.
Or another possible approach is to support temporary table that only lives 
during the query execution time and query expression following WITH clause uses 
that table instead of query name specified in WITH clause.

How about start with the first approach?

> Support WITH clause without RECURSIVE
> -------------------------------------
>
>                 Key: TAJO-1406
>                 URL: https://issues.apache.org/jira/browse/TAJO-1406
>             Project: Tajo
>          Issue Type: New Feature
>          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