如何在pyspark中创建动态数据帧名称
在这里,我无法使用下面的代码创建新的数据帧,它将只给我最后的数据帧名称,我需要所有的数据帧名称
for prime2 in pdf2:
ol2 = Bucket_path + prime2['S3_File_with_Path']
t = 1
sd = {}
testR = "df" + str(t)
print("testR",testR)
sd[testR] = spark.read.format("parquet").load(ol2).cache()
t = t + 1
Tags:
似乎您正在循环中创建dict,因此获取一个只有一个(最后一个)条目的dict。尝试将代码更改为以下内容:
相关问题 更多 >
编程相关推荐