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

Fang-Yu Rao commented on HIVE-27496:
------------------------------------

cc: [~amansinha], [~soumyakanti.das]

> Hive could not handle common table expression (CTE) correctly in some scenario
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-27496
>                 URL: https://issues.apache.org/jira/browse/HIVE-27496
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Fang-Yu Rao
>            Priority: Major
>
> We found that Hive could not handle common table expression (CTE) in some 
> scenario like the following query.
> {code}
> with
>     b as (
>         with a as (select 1)
>         select * from a
>     ),
>     c as (
>         with a as (select * from b)
>         select * from a
>     )
> select * from c;
> {code}
> We will get the following error.
> {code}
> Error: Error while compiling statement: FAILED: SemanticException Recursive 
> cte a detected (cycle: c -> a -> b -> a). (state=42000,code=40000)
> {code}
> The error is incorrect in that the table 'a' referenced by the table 'b', 
> should not be treated as the same table that is referenced in the table 'c'. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to