def f(iterator):
    sizes = []
for i in iterator:
    sizes.append(len(i[1]))
return sizes
rdd.mapPartitions(f).collect()
Most efficient way to access binary files on ADLS from worker node in PySpark?