Skip to content

Conversation

@vofque
Copy link
Contributor

@vofque vofque commented Oct 18, 2018

This PR is to backport #22708 to branch 2.2.

What changes were proposed in this pull request?

MapObjects expression is used to map array elements to java beans. Struct type of elements is inferred from java bean structure and ends up with mixed up field order.
I used UnresolvedMapObjects instead of MapObjects, which allows to provide element type for MapObjects during analysis based on the resolved input data, not on the java bean.

How was this patch tested?

Added a test case.
Built complete project on travis.

@dongjoon-hyun @cloud-fan

@dongjoon-hyun
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Oct 18, 2018

Test build #97545 has finished for PR 22768 at commit 90d3a74.

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

Assert.assertEquals(records, RECORDS);
}

private StructType createSchema() {
Copy link
Member

Choose a reason for hiding this comment

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

So, this is back inevitably. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it managed to survive

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@dongjoon-hyun
Copy link
Member

Merged to branch-2.2.

asfgit pushed a commit that referenced this pull request Oct 18, 2018
…ation

This PR is to backport #22708 to branch 2.2.

## What changes were proposed in this pull request?

MapObjects expression is used to map array elements to java beans. Struct type of elements is inferred from java bean structure and ends up with mixed up field order.
I used UnresolvedMapObjects instead of MapObjects, which allows to provide element type for MapObjects during analysis based on the resolved input data, not on the java bean.

## How was this patch tested?

Added a test case.
Built complete project on travis.

dongjoon-hyun cloud-fan

Closes #22768 from vofque/SPARK-21402-2.2.

Lead-authored-by: Vladimir Kuriatkov <[email protected]>
Co-authored-by: Vladimir Kuriatkov <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun
Copy link
Member

Thank you, @vofque .

@dongjoon-hyun
Copy link
Member

Could you close this PR? Auto-close is only working for master branch PR.

@vofque vofque closed this Oct 18, 2018
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 26, 2019
…ation

This PR is to backport apache#22708 to branch 2.2.

## What changes were proposed in this pull request?

MapObjects expression is used to map array elements to java beans. Struct type of elements is inferred from java bean structure and ends up with mixed up field order.
I used UnresolvedMapObjects instead of MapObjects, which allows to provide element type for MapObjects during analysis based on the resolved input data, not on the java bean.

## How was this patch tested?

Added a test case.
Built complete project on travis.

dongjoon-hyun cloud-fan

Closes apache#22768 from vofque/SPARK-21402-2.2.

Lead-authored-by: Vladimir Kuriatkov <[email protected]>
Co-authored-by: Vladimir Kuriatkov <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 27, 2019
…ation

This PR is to backport apache#22708 to branch 2.2.

## What changes were proposed in this pull request?

MapObjects expression is used to map array elements to java beans. Struct type of elements is inferred from java bean structure and ends up with mixed up field order.
I used UnresolvedMapObjects instead of MapObjects, which allows to provide element type for MapObjects during analysis based on the resolved input data, not on the java bean.

## How was this patch tested?

Added a test case.
Built complete project on travis.

dongjoon-hyun cloud-fan

Closes apache#22768 from vofque/SPARK-21402-2.2.

Lead-authored-by: Vladimir Kuriatkov <[email protected]>
Co-authored-by: Vladimir Kuriatkov <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
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