-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6702] Remove unnecessary calls of getInsertValue api from HoodieRecordPayload
#9572
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
24e7acc to
7e769e6
Compare
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecord.java
Outdated
Show resolved
Hide resolved
7e769e6 to
cf84844
Compare
| Option<Schema> schemaWithoutMetaFields) throws IOException { | ||
| IndexedRecord indexedRecord = (IndexedRecord) data.getInsertValue(recordSchema, props).get(); | ||
| HoodieAvroRecordMerger merger = HoodieAvroRecordMerger.INSTANCE; | ||
| HoodieAvroIndexedRecord record = (HoodieAvroIndexedRecord) merger.merge( |
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.
Let's change the merge API to
Option<Pair<HoodieRecord, Schema>> merge(Option<HoodieRecord> older, Schema oldSchema, Option<HoodieRecord> newer, Schema newSchema, TypedProperties props)
so that we pass in Option.empty instead of null.
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.
Yeah, will create a separate PR for this change.
...hudi-client-common/src/main/java/org/apache/hudi/common/table/log/HoodieFileSliceReader.java
Outdated
Show resolved
Hide resolved
cf84844 to
d6904d0
Compare
This task further removes the leftover of callings of `getInsertValue` from HoodieRecordPayload. Changes: 1. Add a function to HoodieMetadataPayload class to return HoodieMetadataRecord class. 2. Call this function from ColumnStatsIndices and ColumnStatsIndexSupport classes, instead of the `getInsertValue` function. Tests: Existing unit tests.
d6904d0 to
93813ed
Compare
getInsertValue api from HoodieRecordPayload
|
@yihua @danny0405 please comment! Thank you! |
getInsertValue api from HoodieRecordPayloadgetInsertValue api from HoodieRecordPayload
| } catch (IOException e) { | ||
| throw new HoodieException("Exception while getting insert value from metadata payload"); | ||
| } | ||
| GenericRecord genericRecord = (GenericRecord) record.getData().toHoodieMetadataRecord().orElse(null); |
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.
Given that this still calls the HoodieMetadataPayload APIs which implements HoodieRecordPayload, shall we keep these as is? Ideally, once we migrate the metadata payload to new merger API, these can be got rid of.
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.
Yes, we can leave it as is. Sound like it will not block rfc-46. Will undo the change for it.
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.
Just checked the files; if we leave it as is, then there is nothing to change for this PR.
|
This issue should have been fixed together with PR: #9593 |
Change Logs
Impact
No impact on the functional side.
Risk level (write none, low medium or high below)
instead of the
getInsertValuefunction.TESTS:
Contributor's checklist