source

#CSV

mySchema = StructType().add("id", IntegerType(), True).add("name",StringType(),True)
df = spark.readStream.option("sep",",").option("header","false").schema(mySchema).csv(r"D:\myAPP\trancare_dw\test\in_csv")
df.writeStream.format(source="console").outputMode("append").start().awaitTermination()

 

posted @ 2021-06-24 16:08  muyue123  阅读(138)  评论(0编辑  收藏  举报