spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amiya Mishra <>
Subject Re: How to branch a Stream / have multiple Sinks / do multiple Queries on one Stream
Date Thu, 05 Jul 2018 07:33:43 GMT
Hi Chandan/J├╝rgen,

I had tried through a native code having single input data frame with
multiple sinks as :

Spark provides a method called awaitAnyTermination() in
StreamingQueryManager.scala which provides all the required details to
handle the query processed by spark.By observing documentation of spark with
below points :
		-> Wait until any of the queries on the associated SQLContext has
terminated since the creation of the context, or since `resetTerminated()`
was called. If any query was terminated
		-> If a query has terminated, then subsequent calls to
`awaitAnyTermination()` will either return immediately (if the query was
terminated  by `query.stop()`),or throw the exception immediately (if the
query was terminated with exception). Use `resetTerminated()` to clear past
terminations and wait for new terminations.
		-> In the case where multiple queries have terminated since
`resetTermination()` was called, if any query has terminated with exception,
when `awaitAnyTermination()` will throw any of the exception. For correctly
documenting exceptions across multiple queries,users need to  stop all of
them after any of them terminates with exception, and then check the
`query.exception()` for each query.	

val inputdf:DataFrame =
    query1 =
    query2 =

Now, both "first_output" and "second_output" file write successfully.

Try it out on your site and let me know if you found any limitation.And try
to posting if you found any other way.

Let me correct if i had grammatical mistake.


Sent from:

To unsubscribe e-mail:

View raw message