pythonsparkfilter_python – 基于Spark中另一个RDD进行过滤

我想只保留在第二个表中引用了具有一个签名ID的雇员.

Employee table

LastName DepartmentID

Rafferty 31

Jones 33

Heisenberg 33

Robinson 34

Smith 34

Department table

DepartmentID

31

33

我已经尝试了以下代码不起作用:

employee = [['Raffery',31], ['Jones',33], ['Heisenberg',33], ['Robinson',34], ['Smith',34]]

department = [31,33]

employee = sc.parallelize(employee)

department = sc.parallelize(department)

employee.filter(lambda e: e[1] in department).collect()

Py4JError: An error occurred while calling o344.__getnewargs__. Trace:

py4j.Py4JException: Method __getnewargs__([]) does not exist

有任何想法吗?我在使用Spark 1.1.0与Python.但是,我会接受Scala或Python的答案.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值