[ 
https://issues.apache.org/jira/browse/SPARK-26016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16783513#comment-16783513
 ] 

Sean Owen commented on SPARK-26016:
-----------------------------------

[~maxgekk] yeah I'm thinking of parts like 
https://github.com/apache/hadoop/blob/f365957c6326f88734bc0a5d01cfb7eac713db20/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/LineRecordReader.java#L172
 though, which would skip some input if it happened to match the UTF-8 BOM 
bytes. Probably pretty rare in practice, but hey.

At least this needs some docs about the text format only reading/writing UTF-8.

I agree, maybe not worth actually validating the UTF-8 encoding here. But what 
about supporting conversion if a non-UTF-8 encoding is specified? I think that 
could be a pretty clean change, albeit one with perf implications.

> Encoding not working when using a map / mapPartitions call
> ----------------------------------------------------------
>
>                 Key: SPARK-26016
>                 URL: https://issues.apache.org/jira/browse/SPARK-26016
>             Project: Spark
>          Issue Type: Bug
>          Components: Java API
>    Affects Versions: 2.4.0
>            Reporter: Chris Caspanello
>            Priority: Major
>         Attachments: spark-sandbox.zip
>
>
> Attached you will find a project with unit tests showing the issue at hand.
> If I read in a ISO-8859-1 encoded file and simply write out what was read; 
> the contents in the part file matches what was read.  Which is great.
> However, the second I use a map / mapPartitions function it looks like the 
> encoding is not correct.  In addition a simple collectAsList and writing that 
> list of strings to a file does not work either.  I don't think I'm doing 
> anything wrong.  Can someone please investigate?  I think this is a bug.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to