-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-12537] [SQL] Add option to accept quoting of all character backslash quoting mechanism #10497
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-12537] [SQL] Add option to accept quoting of all character backslash quoting mechanism #10497
Changes from 1 commit
93a52b5
8d0f52a
16997c7
cc4ad3b
9b5bf95
a8abb17
c757fe8
41b9231
aac8261
9001ca0
abdbb58
e75ff1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,8 @@ case class JSONOptions( | |
| allowUnquotedFieldNames: Boolean = false, | ||
| allowSingleQuotes: Boolean = true, | ||
| allowNumericLeadingZeros: Boolean = false, | ||
| allowNonNumericNumbers: Boolean = false) { | ||
| allowNonNumericNumbers: Boolean = false, | ||
| allowBackslashEscapingAnyCharacter: Boolean = false) { | ||
|
|
||
| /** Sets config options on a Jackson [[JsonFactory]]. */ | ||
| def setJacksonOptions(factory: JsonFactory): Unit = { | ||
|
|
@@ -40,6 +41,8 @@ case class JSONOptions( | |
| factory.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, allowSingleQuotes) | ||
| factory.configure(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS, allowNumericLeadingZeros) | ||
| factory.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, allowNonNumericNumbers) | ||
| factory.configure(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER, | ||
| allowBackslashEscapingAnyCharacter) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -59,6 +62,8 @@ object JSONOptions { | |
| allowNumericLeadingZeros = | ||
| parameters.get("allowNumericLeadingZeros").map(_.toBoolean).getOrElse(false), | ||
| allowNonNumericNumbers = | ||
| parameters.get("allowNonNumericNumbers").map(_.toBoolean).getOrElse(true) | ||
| parameters.get("allowNonNumericNumbers").map(_.toBoolean).getOrElse(true), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could I ask one more question?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "true" is more flexible isn't it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but I worried confusing when declare class "allowNonNumericNumbers: Boolean = false"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry for lack of english. I know you are very busy
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm suggesting changing the default value to true, and also update all the documentations (as you pointed out) to true.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got it. Thank you! |
||
| allowBackslashEscapingAnyCharacter = | ||
| parameters.get("allowBackslashEscapingAnyCharacter").map(_.toBoolean).getOrElse(false) | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think you need the trailing \ yet