我在蜂巢/黑斑羚中有两张桌子。我想将表中的数据作为 rdds 提取到 spark 中并执行连接操作。
我不想在我的配置单元上下文中直接传递连接查询。这只是一个例子。我有更多标准 HiveQL 无法实现的用例。如何获取所有行、访问列并执行转换。
假设我有两个 rdds:
val table1 = hiveContext.hql("select * from tem1")
val table2 = hiveContext.hql("select * from tem2")
我想在名为“account_id”的列上对 rdds 执行连接
理想情况下,我想使用 rdds 使用 spark shell 来做这样的事情。
select * from tem1 join tem2 on tem1.account_id=tem2.account_id;