Skip to content

Conversation

@rdsr
Copy link
Contributor

@rdsr rdsr commented Oct 26, 2019

Fixes #528

@rdblue . I've written AvroSchemaUtil.hasIds similar to Parquet's, in that if at least 1 field-id is missing we consider the schema to have no ids. This is slightly different from your comment on #528.

@rdsr rdsr changed the title Infer mapping from expected schema if file schema does not have ids and name mapping is missing Infer mapping from expected schema if file schema does not have field-ids and name mapping is missing Oct 26, 2019
@rdblue
Copy link
Contributor

rdblue commented Oct 27, 2019

Thanks @rdsr! Looks good.

I think that the logic should be that if any ID is assigned, we don't use fallback assignment. We have to assume that if a file has any explicit ID then it was written with IDs. I think I got the logic wrong in the Parquet fallback. We should fix that as well (though not in this PR).

@rdsr
Copy link
Contributor Author

rdsr commented Oct 28, 2019

@rdblue, thanks for taking a look. I've addressed your comments.

@rdsr rdsr requested a review from rdblue October 28, 2019 19:14
@rdblue rdblue merged commit c344934 into apache:master Oct 30, 2019
@rdblue
Copy link
Contributor

rdblue commented Oct 30, 2019

Thanks @rdsr! I merged this.

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.

Infer name mapping from expected schema

2 participants