Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-43389][SQL] Added a null check for lineSep option #41904

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class CSVOptions(
* A string between two consecutive JSON records.
*/
val lineSeparator: Option[String] = parameters.get(LINE_SEP).map { sep =>
require(sep != null, "'lineSep' cannot be a null value.")
require(sep.nonEmpty, "'lineSep' cannot be an empty string.")
// Intentionally allow it up to 2 for Window's CRLF although multiple
// characters have an issue with quotes. This is intentionally undocumented.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class TextOptions(@transient private val parameters: CaseInsensitiveMap[String])
val encoding: Option[String] = parameters.get(ENCODING)

val lineSeparator: Option[String] = parameters.get(LINE_SEP).map { lineSep =>
require(lineSep != null, s"'$LINE_SEP' cannot be a null value.")
require(lineSep.nonEmpty, s"'$LINE_SEP' cannot be an empty string.")

lineSep
Expand Down