简体   繁体   中英

Pipeline in Spark Structured Streaming using foreachBatch

Can we chain multiple foreachBatch in Spark Structured streaming?

Eg:

df.writeStream.format("parquet")
    .foreachBatch(pre_process)
    .foreachBatch(mask)
    .trigger(once=True)
    .outputMode("append")
    .option("checkpointLocation", "location")
    .start()

If not possible, can the function in foreachBatch call multiple other batch functions?

Wording of question a little awkward compared to example, but...

  • No chaining evident if you run two such statements.
  • Two foreachBatch es run independently.
  • If you look at the manual and the examples you will see that it is about writing and write guarantees.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM