Created
August 5, 2021 19:56
-
-
Save ychennay/19d54b79066cf8a8a34de07f803db98d to your computer and use it in GitHub Desktop.
Starting Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a custom processor class that we create to handle real-time inference | |
# we'll show the skeleton code for it below | |
processor = RealTimeInferenceProcessor() | |
query = df.writeStream \ | |
.option("checkpointLocation", "dbfs://pathToYourCheckpoint") \ # configure checkpointing in case of job failure | |
.foreachBatch(processor.process_batch) \ # for each micro-batch, apply this method | |
.outputMode("append") \ | |
.start() # start the stream query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment