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

Enable force overwrite for partial upserts #15107

Conversation

himanish-star
Copy link
Contributor

@himanish-star himanish-star commented Feb 21, 2025

Fixes #14924

This PR removes the logic that stops prev column value to be overwritten by new column value if the new value is NULL.

Before:

(null, newValue) -> newValue
(oldValue, null) -> oldValue
(null, null) -> null

After:

(null, newValue) -> newValue
(oldValue, null) -> null
(null, null) -> null

if (newRow.isNullValue(column)) {
resultHolder.put(column, prevValue);
} else {
resultHolder.put(column, merger.merge(prevValue, newRow.getValue(column)));
}
resultHolder.put(column, merger.merge(prevValue, newRow.getValue(column)));
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is backward-incompatible. Going through the attached issue, I would recommend to create a new merger strategy and allow null-overwrites there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 63.53%. Comparing base (59551e4) to head (41fa65b).
Report is 1858 commits behind head on master.

Files with missing lines Patch % Lines
...cal/upsert/merger/PartialUpsertColumnarMerger.java 25.00% 2 Missing and 1 partial ⚠️
...l/upsert/merger/columnar/ForceOverwriteMerger.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15107      +/-   ##
============================================
+ Coverage     61.75%   63.53%   +1.78%     
- Complexity      207     1459    +1252     
============================================
  Files          2436     2760     +324     
  Lines        133233   155337   +22104     
  Branches      20636    23916    +3280     
============================================
+ Hits          82274    98695   +16421     
- Misses        44911    49189    +4278     
- Partials       6048     7453    +1405     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.50% <55.55%> (+1.79%) ⬆️
java-21 63.43% <55.55%> (+1.80%) ⬆️
skip-bytebuffers-false 63.52% <55.55%> (+1.77%) ⬆️
skip-bytebuffers-true 63.40% <55.55%> (+35.68%) ⬆️
temurin 63.53% <55.55%> (+1.78%) ⬆️
unittests 63.53% <55.55%> (+1.78%) ⬆️
unittests1 56.15% <11.11%> (+9.26%) ⬆️
unittests2 33.95% <55.55%> (+6.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@raghukn
Copy link

raghukn commented Feb 23, 2025

Pls update the documentation also with this.

@tibrewalpratik17
Copy link
Contributor

Hey @himanish-star the solution looks good to me! Can you please add unit-test / integration-test for your change too?

@himanish-star
Copy link
Contributor Author

Hey @himanish-star the solution looks good to me! Can you please add unit-test / integration-test for your change too?

Sure, I'll add today

@himanish-star
Copy link
Contributor Author

Pls update the documentation also with this.

Yes, I'll add documentation mentioning the new config value to be set

@himanish-star
Copy link
Contributor Author

added unit tests

@himanish-star
Copy link
Contributor Author

@tibrewalpratik17 I've tested locally using partial upsert quick start and added unit tests and they're working correctly. Shall we move ahead with this PR?

@himanish-star himanish-star changed the title [bugfix] Enable force overwrite for partial upserts Enable force overwrite for partial upserts Feb 25, 2025
@tibrewalpratik17
Copy link
Contributor

LGTM!

cc @Jackie-Jiang @klsince in case you have any comments!

@himanish-star
Copy link
Contributor Author

@Jackie-Jiang do the changes look good to go?

@himanish-star
Copy link
Contributor Author

Hi @deemoliu @tibrewalpratik17 @klsince .... can any one of you merge this PR please?

@Jackie-Jiang Jackie-Jiang merged commit 8997f3a into apache:master Mar 18, 2025
22 checks passed
tsekityam pushed a commit to tsekityam/pinot that referenced this pull request Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null handing issue with Partial upserts and partialUpsertStrategies
7 participants