pySpark-merge多个dataframe
当需要merge多个spark datafame的时候:
from functools import reduce
buff = []
for pdfs in [pdf1, pdf1,pdf3...]:
buff.append(pdfs)
mergeDF = reduce(lambda x,y: x.union(y), buff)
当需要merge多个spark datafame的时候:
from functools import reduce
buff = []
for pdfs in [pdf1, pdf1,pdf3...]:
buff.append(pdfs)
mergeDF = reduce(lambda x,y: x.union(y), buff)