Unsupported SubQuery Expression : Correlating expression cannot contain unqualified column references

HIVE不支持形如
select *
from table_A
where id in
(
    select id from table_B
)
会报错Unsupported SubQuery Expression : Correlating expression cannot contain unqualified column references

但是我记得我以前所用的hive和impala都是支持的,难道是hive版本问题?

修改方法是
select *
from table_A a
where a.id in
(
    select id from table_B
)
系统分不清楚外层的id和in中的id,外层需要加表别名进行区分

留言

熱門文章