我在hive上运行以下查询,
SELECT a, b, c, d, e
FROM A
JOIN B ON A.a = B.a
JOIN C ON A.b = C.a
LIMIT 10;
我一直收到以下错误,
Error while compiling statement: FAILED: SemanticException Column a Found in more than One Tables/Subqueries
答案 0 :(得分:1)
如果查询中有多个表,请限定所有列名称:
SELECT a.a, ?.b, ?.c, ?.d, ?.e
FROM A JOIN
B
ON A.a = B.a JOIN
C
ON A.b = C.a
LIMIT 10;
?
适用于那些列来自的表。另外,在没有LIMIT
的情况下使用ORDER BY
会有点不正统。