bogao007 commented on code in PR #41752:
URL: https://github.com/apache/spark/pull/41752#discussion_r1260163931
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -2909,6 +2918,36 @@ class SparkConnectPlanner(val sessionHolder:
SessionHolder) extends Logging {
session.streams.resetTerminated()
respBuilder.setResetTerminated(true)
+ case StreamingQueryManagerCommand.CommandCase.ADD_LISTENER =>
+ val listenerPacket = Utils
+ .deserialize[StreamingListenerPacket](
+ command.getAddListener.getListenerPayload.toByteArray,
+ Utils.getContextOrSparkClassLoader)
+ val listener: StreamingQueryListener = listenerPacket.listener
+ .asInstanceOf[StreamingQueryListener]
+ val id: String = listenerPacket.id
+ sessionHolder.cacheListenerById(id, listener)
+ session.streams.addListener(listener)
Review Comment:
Are you talking about the cache we introduced here? We'll have to do this
for `removeListener()` to work properly. `spark.write()` inside listener is
working as expected in my manual testing, will update the unit test to cover it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]