Skip to content

[MINOR] Optimizing metadata getter for metadata table #13298

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

Merged
merged 2 commits into from
May 30, 2025

Conversation

nsivabalan
Copy link
Contributor

Change Logs

  • Optimizing metadata getter for metadata table

Impact

  • Optimizing metadata getter for metadata table. Short circuiting getMetadataWriter for metadata table.

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

none.

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

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:S PR with lines of changes in (10, 100] label May 13, 2025
@vinothchandar vinothchandar self-assigned this May 22, 2025
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.

pushed the change myself

Copy link
Contributor

@danny0405 danny0405 left a comment

Choose a reason for hiding this comment

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

is this a over-protection code, how could a MDT invoke the getMetadataWriter method.

@nsivabalan
Copy link
Contributor Author

@danny0405 : from a HoodieTable standpoint, so far we don't differentiate data table vs metadata table.
So, we just call getMetadataWriter() and then trigger an update.
So, when the HoodieTable is referring to a metadata table, when we do getMetadataWriter() it will return Option.empty().
I was just trying to optimize that call to return immediately.

@danny0405
Copy link
Contributor

I was just trying to optimize that call to return immediately.

It is throwing instead of return early which is think is kind of over-protection, because MDT should be disabled in the MDT writer config/table config.

@vinothchandar vinothchandar force-pushed the fixGetMetadatawriterOptimize branch from 24ab49b to d3973f7 Compare May 29, 2025 23:53
@vinothchandar
Copy link
Member

is this a over-protection code, how could a MDT invoke the getMetadataWriter method.
When I threw an exception tests did fail. So legit check here. to be added.

@vinothchandar vinothchandar requested a review from danny0405 May 29, 2025 23:56
Copy link
Contributor

@danny0405 danny0405 left a comment

Choose a reason for hiding this comment

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

+1, returns empty seems more user friendly.

@hudi-bot
Copy link

CI report:

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

@danny0405 danny0405 merged commit 133c2a5 into apache:master May 30, 2025
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S PR with lines of changes in (10, 100]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants