Skip to content

[SPARK-27858][SQL] Fix for avro deserialization on union types with multiple non-null types - #562

Merged
bulldozer-bot[bot] merged 1 commit into
masterfrom
vg/SPARK-27858
May 28, 2019
Merged

[SPARK-27858][SQL] Fix for avro deserialization on union types with multiple non-null types#562
bulldozer-bot[bot] merged 1 commit into
masterfrom
vg/SPARK-27858

Conversation

@vinooganesh

Copy link
Copy Markdown

What changes were proposed in this pull request?

This PR aims to fix an issue on a union avro type with more than one non-null value (for instance ["string", "null", "int"]) whose the deserialization to a DataFrame would throw a java.lang.ArrayIndexOutOfBoundsException. The issue was that the fieldWriter relied on the index from the avro schema before nulls were filtered out.

How was this patch tested?

A test for the case of multiple non-null values was added and the tests were run using sbt by running testOnly org.apache.spark.sql.avro.AvroSuite

…ultiple non-null types

## What changes were proposed in this pull request?

This PR aims to fix an issue on a union avro type with more than one non-null value (for instance `["string", "null", "int"]`) whose the deserialization to a DataFrame would throw a `java.lang.ArrayIndexOutOfBoundsException`. The issue was that the `fieldWriter` relied on the index from the avro schema before nulls were filtered out.

## How was this patch tested?

A test for the case of multiple non-null values was added and the tests were run using sbt by running `testOnly org.apache.spark.sql.avro.AvroSuite`

Closes apache#24722 from gcmerz/master.

Authored-by: Gabbi Merz <gmerz@palantir.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@vinooganesh

vinooganesh commented May 28, 2019

Copy link
Copy Markdown
Author

@vinooganesh
vinooganesh requested review from mccheah and yifeih May 28, 2019 20:33
@gatesn

gatesn commented May 28, 2019

Copy link
Copy Markdown

👍

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.

3 participants