检查在Hive中是否可以这样做:
Select a.col1,b.col1
from tableA a join tableB b on a.col1 = b.col1
lateral view explode(numcred) tableA as creds
where creds.id = 9;
我在文档中找不到答案。总之:
我想在两个表和侧视图分解表上连接
看起来很简单,但抛出了语法问题。
select a.col1
,b.col1
from (Select a.col1
from tableA a
lateral view explode(numcred) e as creds
where e.creds.id = 9
) a
join tableB b
on a.col1 = b.col1
现在不在我的电脑上,所以没有办法测试这个,但我的猜测是你必须编写一个内部查询。像这样:
SELECT
a.col1,
b.col1
FROM (
SELECT
dummy.col1
FROM table_a dummy
LATERAL VIEW EXPLODE(numcred) tableA as creds
WHERE
creds.id = 9
) a
JOIN tableB b
ON
a.col1 = b.col1