You can use python multiprocessing
from multiprocessing import Process
def create_temp_view(df):
df.createOrReplaceTempView("my_table")
def write_df(df):
df.write.mode("overwrite").format("csv").save("my_csv")
p1 = Process(create_temp_view(df))
p1.start()
p2 = Process(write_df(df))
p2.start()
p1.join()
p2.join()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…