嗨,我有以下代码:
for i in range(10):
df_combined = combine_data(df_1, df_2, 1)
df_combined.cache()
df_combined.count()
temp = df_combined
temp = temp.withColumn("months_back", lit(int('{}'.format(i))))
temp.write.mode("overwrite").saveAsTable("adhoc.test_month_{}".format(i),
path="s3://my_path/my_bucket")
但是当我做的时候
select * from test_month_0
我得到与
相同的表格select * from test_month_1
即使对于months_back列,我在两个表中得到值为1。
我做错了什么?