【发布时间】:2019-02-10 06:31:52
【问题描述】:
我的数据是:
User id product_id action
1 apple incart
1 apple purchased
1 banana incart
2 banana incart
2 banana purchased
3 carrot incart
我需要作为 user_id 和 product_id 的输出,其操作只有 incart 而没有购买。
【问题讨论】:
-
同时指定预期结果。并向我们展示您当前的代码尝试。
-
我是 spark 和 hive 的初学者。我需要解决这个问题的方法。输出应显示 user_id 和 product_id,其中 action = incart 且不等于购买。
-
你有 RDD 吗?一个DF?请尝试更具体,并向我们展示您的尝试。
-
@pheeleeppoo 使用 RDD 或 DF 什么都可以。我只需要解决问题的方法。我知道我需要在 user_id 和 product_id 上使用 groupby,但是如何只找到那些有 action= incart 和 action != purchase 记录的 user_id 和 product_id
-
@RupeshMalkar 请立即查看
标签: sql apache-spark hadoop hive