-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-2903] get table schema from the last commit with data written #4180
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
Conversation
I think this should not be a minor and worth filing a jira ticket. |
ok, a little lazy ~ |
|
@hudi-bot run azure |
|
As discussed, let's hold this off. |
9f3823c to
74699cc
Compare
| HoodieInstant lastDeltaInstant = lastDeltaCommit.get(); | ||
| // read from the log file wrote | ||
| commitMetadata = HoodieCommitMetadata.fromBytes(activeTimeline.getInstantDetails(lastDeltaInstant).get(), | ||
| HoodieCommitMetadata commitMetadata = HoodieCommitMetadata.fromBytes(activeTimeline.getInstantDetails(lastDeltaInstant).get(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a chance that last delta commit is empty and does not have valid schema. so, the fix we have done for COW above, might also be required here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have optimized the mor part, please help to review this again.
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
Outdated
Show resolved
Hide resolved
|
@xushiyan : may I know why it was moved to WIP. fix looks ok to me on a high level. have left some feedback. |
nsivabalan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. just one ask for UT. can land then.
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
Show resolved
Hide resolved
6005512 to
92c0642
Compare
|
@nsivabalan add some UT for this. have time to review this again? |
|
sorry, looks like you need to rebase and resolve conflicts. |
|
once rebased and CI is green, we can land this |
92c0642 to
f4cec28
Compare
done for this. |
If the last operation is
delete_partition, theHoodieCommitMetadataobject from the last commit will has an empty getFileIdAndRelativePaths. So we can't get the table schema from it.So, i wanna find the last commit which data is written to.