GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/11756
Parse modes in JSON data source
## What changes were proposed in this pull request?
Currently, there is no way to control the behaviour when fails to parse
corrupt records in JSON data source .
This PR adds the support for parse modes just like CSV data source. There
are three modes below:
- `PERMISSIVE` : When it fails to parse, this sets `null` to to field.
- `DROPMALFORMED`: When it fails to parse, this drops the whole record.
- `FAILFAST`: When it fails to parse, it just throws an exception.
This PR also make JSON data source share the `ParseModes` in CSV data
source.
## How was this patch tested?
Unit tests were used and `./dev/run_tests` for code style tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-13764
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11756.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11756
----
commit 4c46f4b97b062cba06d5b9bb7987b3606b0dd4dc
Author: hyukjinkwon <[email protected]>
Date: 2016-03-16T06:34:29Z
Parse modes in JSON data source
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]