[ 
https://issues.apache.org/jira/browse/SPARK-26303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16716435#comment-16716435
 ] 

ASF GitHub Bot commented on SPARK-26303:
----------------------------------------

SparkQA commented on issue #23253: [SPARK-26303][SQL] Return partial results 
for bad JSON records
URL: https://github.com/apache/spark/pull/23253#issuecomment-446108006
 
 
   **[Test build #99953 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/99953/testReport)**
 for PR 23253 at commit 
[`9ca9248`](https://github.com/apache/spark/commit/9ca9248ed3f9314747c1415bd19760c53019bf36).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `case class PartialResultException(`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Return partial results for bad JSON records
> -------------------------------------------
>
>                 Key: SPARK-26303
>                 URL: https://issues.apache.org/jira/browse/SPARK-26303
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Maxim Gekk
>            Priority: Minor
>
> Currently, JSON datasource and JSON functions return row with all null for a 
> malformed JSON string in the PERMISSIVE mode when specified schema has the 
> struct type. All nulls are returned even some of fields were parsed and 
> converted to desired types successfully. The ticket aims to solve the problem 
> by returning already parsed fields. The corrupted column specified via JSON 
> option `columnNameOfCorruptRecord` or SQL config should contain whole 
> original JSON string. 
> For example, if the input has one JSON string:
> {code:json}
> {"a":0.1,"b":{},"c":"def"}
> {code}
> and specified schema is:
> {code:sql}
> a DOUBLE, b ARRAY<INT>, c STRING, _corrupt_record STRIN
> {code}
> expected output of `from_json` in the PERMISSIVE mode:
> {code}
> +---+----+---+--------------------------+
> |a  |b   |c  |_corrupt_record           |
> +---+----+---+--------------------------+
> |0.1|null|def|{"a":0.1,"b":{},"c":"def"}|
> +---+----+---+--------------------------+
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to