MaxGekk commented on a change in pull request #23080: [SPARK-26108][SQL] 
Support custom lineSep in CSV datasource
URL: https://github.com/apache/spark/pull/23080#discussion_r272696114
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/CSVOptions.scala
 ##########
 @@ -192,6 +192,20 @@ class CSVOptions(
    */
   val emptyValueInWrite = emptyValue.getOrElse("\"\"")
 
+  /**
+   * A string between two consecutive JSON records.
+   */
+  val lineSeparator: Option[String] = parameters.get("lineSep").map { sep =>
+    require(sep.nonEmpty, "'lineSep' cannot be an empty string.")
+    require(sep.length == 1, "'lineSep' can contain only 1 character.")
 
 Review comment:
   >  I must be able to set "\r\n" for lineSep in the settings.
   
   I don't need to set `\r\n` to `lineSep` to split an input by lines because 
Hadoop Line Reader can detect `\r\n` itself. In which mode do you parse the CSV 
files - per-line `multiLine = false` or multiline?

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

Reply via email to