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

Xiao Li resolved SPARK-25660.
-----------------------------
       Resolution: Fixed
         Assignee: Maxim Gekk
    Fix Version/s: 2.4.0

> Impossible to use the backward slash as the CSV fields delimiter 
> -----------------------------------------------------------------
>
>                 Key: SPARK-25660
>                 URL: https://issues.apache.org/jira/browse/SPARK-25660
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Maxim Gekk
>            Assignee: Maxim Gekk
>            Priority: Minor
>             Fix For: 2.4.0
>
>
> If fields in CSV input are delimited by *'\'*, for example:
> {code}
> 123\4\5\1\Q\\P\P\2321213\1\\\P\\F
> {code}
> reading it by the code:
> {code:python}
> df = 
> spark.read.format('csv').option("header","false").options(delimiter='\\').load("file:///file.csv")
> {code}
> causes the exception:
> {code}
> String index out of range: 1
> java.lang.StringIndexOutOfBoundsException: String index out of range: 1
>       at java.lang.String.charAt(String.java:658)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVUtils$.toChar(CSVUtils.scala:101)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVOptions.<init>(CSVOptions.scala:86)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVOptions.<init>(CSVOptions.scala:41)
>       at org.apache.spark.sql.DataFrameReader.csv(DataFrameReader.scala:488)
> {code}



--
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