MaxGekk commented on a change in pull request #25845: [SPARK-29160][CORE] Use
UTF-8 explicitly for reading/writing event log file
URL: https://github.com/apache/spark/pull/25845#discussion_r326024723
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/ReplayListenerBus.scala
##########
@@ -54,7 +55,7 @@ private[spark] class ReplayListenerBus extends
SparkListenerBus with Logging {
sourceName: String,
maybeTruncated: Boolean = false,
eventsFilter: ReplayEventsFilter = SELECT_ALL_FILTER): Unit = {
- val lines = Source.fromInputStream(logData).getLines()
+ val lines = Source.fromInputStream(logData,
StandardCharsets.UTF_8.name()).getLines()
Review comment:
You could avoid converting the charset to string and looking it up again by:
```scala
val lines = Source.fromInputStream(logData)(Codec.UTF8).getLines()
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]