Advertisement
mbruns

read_stream-write_stream-json

Jun 10th, 2022
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARK 0.18 KB | None | 0 0
  1. spark
  2.   .readStream
  3.   .select($"value".cast("string").alias("jsonData"))
  4.   .select(from_json($"jsonData",jsonSchema).alias("payload"))
  5.   .writeStream
  6.   .trigger("1 seconds")
  7.   .start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement