Skip to content

MR: support imported data reads in input format by using name mapping#3312

Merged
rdblue merged 1 commit into
apache:masterfrom
edgarRd:mr-name-mapping
Oct 18, 2021
Merged

MR: support imported data reads in input format by using name mapping#3312
rdblue merged 1 commit into
apache:masterfrom
edgarRd:mr-name-mapping

Conversation

@edgarRd

@edgarRd edgarRd commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

Adding name mapping to readers built in IcebergInputFormat. This will allow Hive to read data imported during Hive -> Iceberg table migration, which otherwise fails with NPE while trying to resolve the Iceberg types in the parquet/orc files.

Since the change is pretty straightforward - and we have this same behavior in all other readers - I've not added more unit tests. We also already have extensive name mapping unit tests. However, if folks feel we need a unit test for this I'm happy to add it. I've validated this change by reading via Hive using the IcebergInputFormat on a migrated table.

PTAL @pvary @aokolnychyi

@github-actions github-actions Bot added the MR label Oct 18, 2021
if (reuseContainers) {
avroReadBuilder.reuseContainers();
}
if (nameMapping != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: empty line bewteen control flow statements

@rdblue rdblue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. A minor nit on formatting, but otherwise good.

@rdblue rdblue merged commit 34e72b5 into apache:master Oct 18, 2021
@rdblue

rdblue commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

Thanks, @edgarRd!

@edgarRd

edgarRd commented Oct 18, 2021

Copy link
Copy Markdown
Contributor Author

Thanks, @rdblue!

@edgarRd edgarRd deleted the mr-name-mapping branch October 19, 2021 14:12
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.

2 participants