You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Punit Shah (Jira)" <ji...@apache.org> on 2020/10/01 12:38:00 UTC

[jira] [Reopened] (SPARK-32965) pyspark reading csv files with utf_16le encoding

     [ https://issues.apache.org/jira/browse/SPARK-32965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Punit Shah reopened SPARK-32965:
--------------------------------

The linked duplicate issue won't be fixed because the issue was mixed with a multiline feature issue.  However my ticket exclusively deals with utf-16le and utf-16be encoding not being handled correctly via pyspark.

Therefore this issue is still open and unresolved.

> pyspark reading csv files with utf_16le encoding
> ------------------------------------------------
>
>                 Key: SPARK-32965
>                 URL: https://issues.apache.org/jira/browse/SPARK-32965
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.7, 3.0.0, 3.0.1
>            Reporter: Punit Shah
>            Priority: Major
>         Attachments: 16le.csv, 32965.png
>
>
> If you have a file encoded in utf_16le or utf_16be and try to use spark.read.csv("<file_name>", encoding="utf_16le") the dataframe isn't rendered properly
> if you use python decoding like:
> prdd = spark_session._sc.binaryFiles(path_url).values().flatMap(lambda x : x.decode("utf_16le").splitlines())
> and then do spark.read.csv(prdd), then it works.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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