gjxdxh commented on code in PR #50780:
URL: https://github.com/apache/spark/pull/50780#discussion_r2072222250


##########
python/pyspark/sql/streaming/listener.py:
##########
@@ -178,29 +178,43 @@ class QueryStartedEvent:
     """
 
     def __init__(
-        self, id: uuid.UUID, runId: uuid.UUID, name: Optional[str], timestamp: 
str
+        self, id: uuid.UUID,
+        runId: uuid.UUID,
+        name: Optional[str],
+        timestamp: str,
+        jobTags: Set[str] = set(),
     ) -> None:
         self._id: uuid.UUID = id
         self._runId: uuid.UUID = runId
         self._name: Optional[str] = name
         self._timestamp: str = timestamp
+        self._jobTags: Set[str] = jobTags
 
     @classmethod
     def fromJObject(cls, jevent: "JavaObject") -> "QueryStartedEvent":
+        jobTags = set()
+        javaIterator = jevent.jobTags().iterator()
+        while javaIterator.hasNext():
+            jobTags.add(javaIterator.next().toString())

Review Comment:
   Not sure what is the best way to convert a Java set object to a python set. 
I tried something like `set(jevent.jobTags().toArray())` but it didn't work, 
this iterator approach seems to be working 



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to