Skip to content

Conversation

@linliu-code
Copy link
Collaborator

@linliu-code linliu-code commented Aug 30, 2023

Change Logs

Impact

No impact on the functional side.

Risk level (write none, low medium or high below)

  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:

  1. No functional changes and existing tests should be sufficient.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@linliu-code linliu-code force-pushed the extending_merger_api branch 2 times, most recently from 24e7acc to 7e769e6 Compare August 30, 2023 01:09
@linliu-code linliu-code force-pushed the extending_merger_api branch from 7e769e6 to cf84844 Compare August 30, 2023 23:11
@linliu-code linliu-code changed the title Utilize merger to replace insertValue api [WIP][HUDI-6702]Utilize merger to replace insertValue api Aug 30, 2023
@linliu-code linliu-code marked this pull request as draft August 30, 2023 23:13
Option<Schema> schemaWithoutMetaFields) throws IOException {
IndexedRecord indexedRecord = (IndexedRecord) data.getInsertValue(recordSchema, props).get();
HoodieAvroRecordMerger merger = HoodieAvroRecordMerger.INSTANCE;
HoodieAvroIndexedRecord record = (HoodieAvroIndexedRecord) merger.merge(
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@linliu-code linliu-code force-pushed the extending_merger_api branch from cf84844 to d6904d0 Compare August 31, 2023 18:18
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.
@linliu-code linliu-code force-pushed the extending_merger_api branch from d6904d0 to 93813ed Compare August 31, 2023 20:09
@linliu-code linliu-code changed the title [WIP][HUDI-6702]Utilize merger to replace insertValue api [WIP][HUDI-6702] Remove unnecessary calls of getInsertValue api from HoodieRecordPayload Aug 31, 2023
@linliu-code linliu-code marked this pull request as ready for review August 31, 2023 20:28
@linliu-code linliu-code requested review from danny0405 and yihua August 31, 2023 20:28
@linliu-code
Copy link
Collaborator Author

@yihua @danny0405 please comment! Thank you!

@hudi-bot
Copy link
Collaborator

hudi-bot commented Sep 1, 2023

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@linliu-code linliu-code changed the title [WIP][HUDI-6702] Remove unnecessary calls of getInsertValue api from HoodieRecordPayload [HUDI-6702] Remove unnecessary calls of getInsertValue api from HoodieRecordPayload Sep 2, 2023
} catch (IOException e) {
throw new HoodieException("Exception while getting insert value from metadata payload");
}
GenericRecord genericRecord = (GenericRecord) record.getData().toHoodieMetadataRecord().orElse(null);
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@linliu-code linliu-code closed this Sep 8, 2023
@linliu-code
Copy link
Collaborator Author

This issue should have been fixed together with PR: #9593

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.

4 participants