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

[HUDI-8183] throw exception if key does not exist in record #11934

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonvex
Copy link
Contributor

@jonvex jonvex commented Sep 12, 2024

Change Logs

If the recordkey field doesn't exist at all, throw an exception

Impact

Currently happens silently so user won't know until they query the record

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

low

Documentation Update

N/A

Contributor's checklist

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

@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Sep 12, 2024
@jonvex jonvex marked this pull request as ready for review September 19, 2024 18:27
@hudi-bot
Copy link

CI report:

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

String recordKeyValue = HoodieAvroUtils.getNestedFieldValAsString(record, recordKeyField, true, consistentLogicalTimestampEnabled);
String recordKeyValue;
try {
recordKeyValue = HoodieAvroUtils.getNestedFieldValAsString(record, recordKeyField, false, consistentLogicalTimestampEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test case where the nested field does not exist and assert that the exception is thrown?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also create a follow-up JIRA to revisit all places this method can return null for non-existent field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS PR with lines of changes in <= 10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants