-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-48658][SQL] Encode/Decode functions report coding errors instead of mojibake for unmappable characters #47017
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
Changes from 6 commits
6426fdd
aee78a5
afb2d08
f6dd4fa
851135c
d3473a4
3e90976
b0cf6ee
64f3c39
9d2583c
8f5a236
d7a4199
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Project [decode(cast(g#0 as binary), UTF-8, false) AS decode(g, UTF-8)#0] | ||
| Project [decode(cast(g#0 as binary), UTF-8, false, false) AS decode(g, UTF-8)#0] | ||
| +- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Project [encode(g#0, UTF-8, false) AS encode(g, UTF-8)#0] | ||
| Project [encode(g#0, UTF-8, false, false) AS encode(g, UTF-8)#0] | ||
| +- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Project [encode(g#0, UTF-8, false) AS to_binary(g, utf-8)#0] | ||
| Project [encode(g#0, UTF-8, false, false) AS to_binary(g, utf-8)#0] | ||
| +- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5002,6 +5002,14 @@ object SQLConf { | |
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val LEGACY_CODING_ERROR_ACTION = buildConf("spark.sql.legacy.codingErrorAction") | ||
| .internal() | ||
| .doc("When set to true, encode/decode functions replace unmappable characters with mojibake " + | ||
| "instead of reporting coding errors.") | ||
| .version("4.0.0") | ||
| .booleanConf | ||
| .createWithDefault(false) | ||
|
Member
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 wonder if it should be a fallback conf to ANSI.
Member
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. The reasons I'd like to make it independent of ANSI are:
The reasons mentioned above indicate that this behavior is more of a legacy trait of Spark itself. |
||
|
|
||
| val LEGACY_EVAL_CURRENT_TIME = buildConf("spark.sql.legacy.earlyEvalCurrentTime") | ||
| .internal() | ||
| .doc("When set to true, evaluation and constant folding will happen for now() and " + | ||
|
|
@@ -5976,6 +5984,8 @@ class SQLConf extends Serializable with Logging with SqlApiConf { | |
|
|
||
| def legacyJavaCharsets: Boolean = getConf(SQLConf.LEGACY_JAVA_CHARSETS) | ||
|
|
||
| def legacyCodingErrorAction: Boolean = getConf(SQLConf.LEGACY_CODING_ERROR_ACTION) | ||
|
|
||
| def legacyEvalCurrentTime: Boolean = getConf(SQLConf.LEGACY_EVAL_CURRENT_TIME) | ||
|
|
||
| /** ********************** SQLConf functionality methods ************ */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.