Fang-Yu Rao created HIVE-27496:
----------------------------------
Summary: 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
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)