-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-13953][SQL] Specifying the field name for corrupted record via option at JSON datasource #11881
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc @cloud-fan @rxin |
``null`` for extra fields. | ||
* ``DROPMALFORMED`` : ignores the whole corrupted records. | ||
* ``FAILFAST`` : throws an exception when it meets corrupted records. | ||
* ``columnNameOfCorruptRecord`` (default ``_corrupt_record``): allows renaming the \ | ||
new field having malformed string created by ``PERMISSIVE`` mode. \ | ||
This overwrites ``spark.sql.columnNameOfCorruptRecord``. |
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.
overrides?
LGTM, pending tests |
Test build #53756 has finished for PR 11881 at commit
|
Test build #53758 has finished for PR 11881 at commit
|
thanks, merging to master. |
roygao94
pushed a commit
to roygao94/spark
that referenced
this pull request
Mar 22, 2016
… option at JSON datasource ## What changes were proposed in this pull request? https://issues.apache.org/jira/browse/SPARK-13953 Currently, JSON data source creates a new field in `PERMISSIVE` mode for storing malformed string. This field can be renamed via `spark.sql.columnNameOfCorruptRecord` option but it is a global configuration. This PR make that option can be applied per read and can be specified via `option()`. This will overwrites `spark.sql.columnNameOfCorruptRecord` if it is set. ## How was this patch tested? Unit tests were used and `./dev/run_tests` for coding style tests. Author: hyukjinkwon <[email protected]> Closes apache#11881 from HyukjinKwon/SPARK-13953.
HyukjinKwon
added a commit
to databricks/spark-xml
that referenced
this pull request
Sep 10, 2016
#105 Currently, this library does not support `PERMISSIVE` parse mode. Similar with JSON data source, this also can be done in the same way with `_corrupt_record`. This PR adds the support for `PERMISSIVE` mode and make this behaviour consistent with the other data sources supporting parse modes (JSON and CSV data sources.) Also, this PR adds the support for `_corrupt_record`. This PR is similar with apache/spark#11756 and apache/spark#11881. Author: hyukjinkwon <[email protected]> Closes #107 from HyukjinKwon/ISSUE-105-permissive.
beluisterql
added a commit
to beluisterql/spark-xml
that referenced
this pull request
Aug 4, 2024
databricks/spark-xml#105 Currently, this library does not support `PERMISSIVE` parse mode. Similar with JSON data source, this also can be done in the same way with `_corrupt_record`. This PR adds the support for `PERMISSIVE` mode and make this behaviour consistent with the other data sources supporting parse modes (JSON and CSV data sources.) Also, this PR adds the support for `_corrupt_record`. This PR is similar with apache/spark#11756 and apache/spark#11881. Author: hyukjinkwon <[email protected]> Closes #107 from HyukjinKwon/ISSUE-105-permissive.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
https://issues.apache.org/jira/browse/SPARK-13953
Currently, JSON data source creates a new field in
PERMISSIVE
mode for storing malformed string.This field can be renamed via
spark.sql.columnNameOfCorruptRecord
option but it is a global configuration.This PR make that option can be applied per read and can be specified via
option()
. This will overwritesspark.sql.columnNameOfCorruptRecord
if it is set.How was this patch tested?
Unit tests were used and
./dev/run_tests
for coding style tests.