使用Spark Structured Streaming处理后删除文件

sau*_*ook 7 apache-spark spark-structured-streaming

在Spark Structures Streaming中使用文件源,并希望在处理完文件后删除它们.

我读的充满JSON文件(目录1.json,2.json等等),然后写他们的镶木文件.我想在成功处理后删除每个文件.

小智 2

该文档指出了 cleanSource 的用法。

cleanSource: option to clean up completed files after processing.
Available options are "archive", "delete", "off". If the option is not provided, the default value is "off".
Run Code Online (Sandbox Code Playgroud)

请参阅:https ://spark.apache.org/docs/latest/structed-streaming-programming-guide.html#input-sources