Skip to content

[WIP] [HUDI-834] Concrete signature of HoodieRecordPayload#combineAndGetUpdateValue & HoodieRecordPayload#getInsertValue#1557

Closed
tisonkun wants to merge 1 commit intoapache:masterfrom
tisonkun:HUDI-834
Closed

[WIP] [HUDI-834] Concrete signature of HoodieRecordPayload#combineAndGetUpdateValue & HoodieRecordPayload#getInsertValue#1557
tisonkun wants to merge 1 commit intoapache:masterfrom
tisonkun:HUDI-834

Conversation

@tisonkun
Copy link
Member

What is the purpose of the pull request

So far, the return type of HoodieRecordPayload#combineAndGetUpdateValue & HoodieRecordPayload#getInsertValue is effectively Option. Instead of doing unchecked cast at

org/apache/hudi/hadoop/realtime/RealtimeCompactedRecordReader.java:88

I propose we use Option as the return type of these two method, which replaces current Option.

FYI, I encounter this ticket when trying to get rid of self type parameter in HoodieRecordPayload and found that it is a bit awkward if we don't take a self type while doing this casting. Fortunately it is the fact that we can directly concrete it.

cc @vinothchandar @leesf

Verify this pull request

This pull request is code refactor should be covered by existing tests.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

…ateValue & HoodieRecordPayload#getInsertValue
@codecov-io
Copy link

Codecov Report

Merging #1557 into master will decrease coverage by 0.66%.
The diff coverage is 40.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1557      +/-   ##
============================================
- Coverage     72.35%   71.69%   -0.67%     
  Complexity      294      294              
============================================
  Files           374      378       +4     
  Lines         16377    16549     +172     
  Branches       1650     1670      +20     
============================================
+ Hits          11849    11864      +15     
- Misses         3797     3954     +157     
  Partials        731      731              
Impacted Files Coverage Δ Complexity Δ
...he/hudi/common/model/EmptyHoodieRecordPayload.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...rg/apache/hudi/common/model/HoodieAvroPayload.java 84.61% <ø> (ø) 0.00 <0.00> (ø)
.../apache/hudi/common/model/HoodieRecordPayload.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...ava/org/apache/hudi/payload/AWSDmsAvroPayload.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...i/common/model/OverwriteWithLatestAvroPayload.java 56.25% <100.00%> (ø) 0.00 <0.00> (ø)
...di/hadoop/realtime/HoodieRealtimeRecordReader.java 70.00% <0.00%> (-14.22%) 0.00% <0.00%> (ø%)
...ain/java/org/apache/hudi/avro/HoodieAvroUtils.java 84.82% <0.00%> (-8.32%) 0.00% <0.00%> (ø%)
...i/common/table/timeline/TimelineMetadataUtils.java 93.02% <0.00%> (-2.22%) 0.00% <0.00%> (ø%)
.../org/apache/hudi/table/HoodieCommitArchiveLog.java 76.43% <0.00%> (-1.06%) 0.00% <0.00%> (ø%)
...i/common/table/timeline/HoodieDefaultTimeline.java 92.30% <0.00%> (-0.12%) 0.00% <0.00%> (ø%)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddd105b...43a5543. Read the comment docs.

@tisonkun
Copy link
Member Author

Hold if HoodieRecordPayload already user facing, we cannot change signature of the interface then.

@hmatu
Copy link
Contributor

hmatu commented Apr 23, 2020

+1, LGTM

@vinothchandar vinothchandar self-assigned this Apr 24, 2020
Copy link
Member

@vinothchandar vinothchandar left a comment

Choose a reason for hiding this comment

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

Marking this as WIP for further discussion.. Thanks @tisonkun for taking a pass at this..

It's an user facing API.. we cannot break it.. We could introduce something new MergeHooks and still respect the Payload class if that's doable.. say.. Need to think more deeply

@vinothchandar vinothchandar changed the title [HUDI-834] Concrete signature of HoodieRecordPayload#combineAndGetUpdateValue & HoodieRecordPayload#getInsertValue [WIP] [HUDI-834] Concrete signature of HoodieRecordPayload#combineAndGetUpdateValue & HoodieRecordPayload#getInsertValue Apr 24, 2020
@vinothchandar vinothchandar added the status:in-progress Work in progress label May 13, 2020
@vinothchandar
Copy link
Member

Closing with a WIP tag for future follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:in-progress Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants