JoshRosen commented on code in PR #36885:
URL: https://github.com/apache/spark/pull/36885#discussion_r912193196
##########
core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala:
##########
@@ -86,18 +84,17 @@ private[spark] class EventLoggingListener(
private def initEventLog(): Unit = {
val metadata = SparkListenerLogStart(SPARK_VERSION)
- val eventJson = JsonProtocol.logStartToJson(metadata)
- val metadataJson = compact(eventJson)
- logWriter.writeEvent(metadataJson, flushLogger = true)
+ val eventJson = JsonProtocol.sparkEventToJsonString(metadata)
+ logWriter.writeEvent(eventJson, flushLogger = true)
Review Comment:
Yes, the current code needs to materialize each event as a single JSON
string. In principle we could do the write in a streaming fashion by keeping a
handle to an output stream. Streaming writes could make it slightly trickier to
recover from individual event writing failures, though (e.g. try to serialize
but bail out and drop an event if the write fails).
--
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]