Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORC-562:Don't wrap readerSchema in acidSchema, if readerSchema is alr… #442

Closed
wants to merge 1 commit into from

Conversation

lcspinter
Copy link

…eady acid

Copy link
Contributor

@omalley omalley left a comment

Choose a reason for hiding this comment

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

You really need to add a test case as well.

@@ -87,7 +87,8 @@ public SchemaEvolution(TypeDescription fileSchema,
this.fileSchema = fileSchema;
this.isAcid = checkAcidSchema(fileSchema);
this.includeAcidColumns = options.getIncludeAcidColumns();
this.readerColumnOffset = isAcid ? acidEventFieldNames.size() : 0;
this.readerColumnOffset = (isAcid && readerSchema != null && checkAcidSchema(readerSchema)) || !isAcid
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest keeping the checkAcidSchema(readerSchema) rather than calling it multiple times. This expression needs to be simplified.

@@ -87,7 +87,8 @@ public SchemaEvolution(TypeDescription fileSchema,
this.fileSchema = fileSchema;
this.isAcid = checkAcidSchema(fileSchema);
this.includeAcidColumns = options.getIncludeAcidColumns();
this.readerColumnOffset = isAcid ? acidEventFieldNames.size() : 0;
this.readerColumnOffset = (isAcid && readerSchema != null && checkAcidSchema(readerSchema)) || !isAcid
? 0 : acidEventFieldNames.size();
if (readerSchema != null) {
if (isAcid) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably want to cut out here with if (isAcid && !isReaderAcid) rather than change addEventSchema.

@lcspinter
Copy link
Author

@omalley I changed the implementation and added new test.

Copy link
Contributor

@omalley omalley left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@omalley omalley left a comment

Choose a reason for hiding this comment

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

Thanks!

omalley pushed a commit that referenced this pull request Nov 5, 2019
…eady acid

Fixes #442

Signed-off-by: Owen O'Malley <omalley@apache.org>
@omalley
Copy link
Contributor

omalley commented Nov 5, 2019

I've committed this.

@omalley omalley closed this Nov 5, 2019
abstractdog pushed a commit to abstractdog/orc that referenced this pull request Nov 6, 2019
…eady acid

Fixes apache#442

Signed-off-by: Owen O'Malley <omalley@apache.org>
mustafaiman pushed a commit to mustafaiman/orc that referenced this pull request Nov 18, 2019
…hema is already acid

Fixes apache#442

Signed-off-by: Owen O'Malley <omalley@apache.org>
(cherry picked from commit 2db32a8)
Change-Id: Icfc548d19b0d0cc62b3e0e90ea164c791ece0a94
stiga-huang pushed a commit to stiga-huang/orc that referenced this pull request Jan 18, 2020
…eady acid

Fixes apache#442

Signed-off-by: Owen O'Malley <omalley@apache.org>
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.

None yet

2 participants