如何在 Hive 中编写非等值连接
我的表包括 3 个日期列: dateA 、 dateB 和 dateC 我的要求:
JOIN ON dateA between dateB and dateC
JOIN 在 Teradata 中运行得很好,但在 Hive 中运行时出现错误。
select *
from
table A
left join table B
on A.col1 = B.col1
and A.dateA between B.dateB and B.dateC
错误:
JOIN dateB 中同时遇到左右别名
我真的很感激一些帮助!
My tables include 3 date columns, dateA , dateB and dateC
What I require:
JOIN ON dateA between dateB and dateC
The JOIN works quite well in Teradata, but I'm getting errors while running in Hive.
select *
from
table A
left join table B
on A.col1 = B.col1
and A.dateA between B.dateB and B.dateC
Error:
Both left and right aliases encountered in JOIN dateB
I would really appreciate some help on this!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原因是 Hive 不支持非等值连接。将 BETWEEN 连接条件移至 WHERE
The reason is Hive does not support non-equi joins. Move the BETWEEN join condition to the WHERE