[英]How can I run a Spark structured streaming job for a certain time?
I want to schedule a Spark structured streaming job each day.我想每天安排一个 Spark 结构化流作业。 The Job itself must run for a certain number of hours and then stop.
作业本身必须运行一定的小时数然后停止。 So, how can I specify such time duration?
那么,我该如何指定这样的持续时间呢?
You need to schedule job with databricks scheduler once a day and then in the code add a timeout to your query:您需要每天使用 databricks 调度程序安排作业,然后在代码中为您的查询添加超时:
query = (df.writeStream...)
query.awaitTermination(timeoutInSeconds)
query.stop()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.