我有下表作为RDD:
Key Value
1 y
1 y
1 y
1 n
1 n
2 y
2 n
2 n
Run Code Online (Sandbox Code Playgroud)
我想从中删除所有重复项Value
.
输出应该是这样的:
Key Value
1 y
1 n
2 y
2 n
Run Code Online (Sandbox Code Playgroud)
在pyspark中工作时,输出应该是键值对列表,如下所示:
[(u'1',u'n'),(u'2',u'n')]
Run Code Online (Sandbox Code Playgroud)
我不知道如何在for
这里应用循环.在普通的Python程序中,它会非常简单.
我想知道是否有pyspark
相同的功能.
尝试编译以下函数时出现以下错误:
Error: invalid operands of types int and const char [3] to binary operator
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
string getFormattedDate()
{
formattedDate = Date.getDay() << "/" << Date.getMonth() << "/" << Date.getYear();
return formattedDate;
}
Run Code Online (Sandbox Code Playgroud)