[ 
https://issues.apache.org/jira/browse/TAJO-1791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jihoon Son resolved TAJO-1791.
------------------------------
    Resolution: Duplicate

> Cannot recognize column name from FROM subquery
> -----------------------------------------------
>
>                 Key: TAJO-1791
>                 URL: https://issues.apache.org/jira/browse/TAJO-1791
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Dongkyu Hwangbo
>            Priority: Minor
>              Labels: sql
>
> This is TPC-H q13 in TPC-H Reference document.
> {code:SQL}
> select
>       c_count, count(*) as custdist
> from (
>       select
>               c_custkey, count(o_orderkey)
>       from
>               customer
>       left outer join orders 
>       on c_custkey = o_custkey
>       and o_comment not like '%special%requests%'
>       group by c_custkey
> )as c_orders(c_custkey, c_count)
> group by c_count
> order by custdist desc, c_count desc;
> {code}
> TAJO cannot run this query because of this line.
> {code:SQL}
> as c_orders(c_custkey, c_count)
> {code}
> To run this query, modify a little bit like below.
> {code:SQL}
> select
>       c_count, count(*) as custdist
> from (
>       select
>               c_custkey, count(o_orderkey) c_count
>       from
>               customer
>       left outer join orders 
>       on c_custkey = o_custkey
>       and o_comment not like '%special%requests%'
>       group by c_custkey
> )as c_orders
> group by c_count
> order by custdist desc, c_count desc;
> {code}



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

Reply via email to