Skip to content

Conversation

@Peng-Lei
Copy link
Contributor

What changes were proposed in this pull request?

In https://issues.apache.org/jira/browse/SPARK-35094, When use spark from_json(JsonToStruct) function in permissive mode to handle the case of contains incorrect nested json fields. It will return wrong value.

Why are the changes needed?

It is necessary to ensure that the data is correct.

Does this PR introduce any user-facing change?

No

How was this patch tested?

unit test

@github-actions github-actions bot added the SQL label Apr 20, 2021
@AngersZhuuuu
Copy link
Contributor

pls change UT to [SPARK-35094][SQL] xxx

@Peng-Lei Peng-Lei changed the title fix spark-35094 [SPARK-35094][SQL]Spark from_json(JsonToStruct) function return wrong value in permissive mode Apr 20, 2021
@Peng-Lei
Copy link
Contributor Author

@MaxGekk Hi, could you please help to review on this ? thanks

@Peng-Lei
Copy link
Contributor Author

pls change UT to [SPARK-35094][SQL] xxx

@AngersZhuuuu done

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@MaxGekk
Copy link
Member

MaxGekk commented Apr 21, 2021

@HyukjinKwon Could you help to review this PR, please. It is related to #30031, I guess.

}
}

test("SPARK-35094: Spark from_json(JsonToStruct) function return wrong value " +
Copy link
Member

Choose a reason for hiding this comment

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

@Peng-Lei this test passes without your fix. Can you show the reproducible codes with before/after results?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HyukjinKwon I am so sorry, It did pass without my fix. My fix is simply skipping the parsing when an parsing exception occurs.

@Peng-Lei Peng-Lei closed this Apr 23, 2021
@dongjoon-hyun
Copy link
Member

Hi, All and @HyukjinKwon .
Is the patch also invalid in this case?

@HyukjinKwon
Copy link
Member

yeah, I think so.

@HyukjinKwon
Copy link
Member

updated the JIRA 👍

@dongjoon-hyun
Copy link
Member

Thank you so much for the confirmation, @HyukjinKwon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants