Skip to content

[MINOR] Reuse empty InternalSchema instance#7287

Merged
codope merged 1 commit intoapache:masterfrom
trushev:reuse-empty
Nov 30, 2022
Merged

[MINOR] Reuse empty InternalSchema instance#7287
codope merged 1 commit intoapache:masterfrom
trushev:reuse-empty

Conversation

@trushev
Copy link
Contributor

@trushev trushev commented Nov 23, 2022

Change Logs

When schema evolution is disabled each instance of HoodieAvroDataBlock calls getEmptyInternalSchema() which triggers creation of ArrayList and InternalSchema. We can easily avoid unnecessary object creation by reusing empty schema.

Impact

Avoid unnecessary creation of empty InternalSchema

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

Low

Documentation Update

None

Contributor's checklist

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

@codope codope added area:schema Schema evolution and data types priority:medium Moderate impact; usability gaps labels Nov 29, 2022
Copy link
Member

@codope codope left a comment

Choose a reason for hiding this comment

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

@trushev Change looks good. Thanks for the contribution. Can you please rebase?

@trushev
Copy link
Contributor Author

trushev commented Nov 29, 2022

@codope thanks, it's rebased

@hudi-bot
Copy link
Collaborator

CI report:

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

@codope codope merged commit 2cdaa60 into apache:master Nov 30, 2022
vamshigv pushed a commit to vamshigv/hudi that referenced this pull request Dec 1, 2022
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:schema Schema evolution and data types priority:medium Moderate impact; usability gaps

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants