Skip to content

Conversation

@HyukjinKwon
Copy link
Member

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.

@HyukjinKwon
Copy link
Member Author

cc @cloud-fan @rxin

* ``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``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overrides?

@cloud-fan
Copy link
Contributor

LGTM, pending tests

@SparkQA
Copy link

SparkQA commented Mar 22, 2016

Test build #53756 has finished for PR 11881 at commit e274b5d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 22, 2016

Test build #53758 has finished for PR 11881 at commit 73a8913.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master.

@asfgit asfgit closed this in 4e09a0d Mar 22, 2016
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 <gurwls223@gmail.com>

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 <gurwls223@gmail.com>

Closes #107 from HyukjinKwon/ISSUE-105-permissive.
@HyukjinKwon HyukjinKwon deleted the SPARK-13953 branch January 2, 2018 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants