pyspark中的 UDF
target_bundle_list = [["PP", 1,4],["PP", 17,4],["PP3", 18,4],["PP2", 1,4],["PP", 10,4]]
def getBundlesTarget(target_bundle_list): def temp3(country): target_bundle_list_ = [(i[1]) for i in target_bundle_list if i[0].upper() == "PP"] return [element for element in target_bundle_list_] return udf(temp3, ArrayType(IntegerType()))
增加的列为一个Array类型


浙公网安备 33010602011771号