-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BugFix] fix concat expr with multiple args nullsFraction #52683
Conversation
a37a84c
to
b74ec4d
Compare
nullsFraction = 1 - childColumnStatisticList.stream().mapToDouble(ColumnStatistic::getAverageRowSize) | ||
.reduce(1, (a, b) -> (1 - a) * (1 - b)); | ||
nullsFraction = 1 - childColumnStatisticList.stream().mapToDouble(ColumnStatistic::getNullsFraction) | ||
.reduce(1.0, (a, b) -> a * (1 - b)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why no (1-a) * (1-b)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if nullsFraction are [a, b, c], isn't our expectation 1 - ((1 - a) * (1 - b) * (1- c))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rename the parameters ? not a/b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: stephen <[email protected]>
b74ec4d
to
1ee869e
Compare
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 2 / 2 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: stephen <[email protected]> (cherry picked from commit 3b8e683)
Signed-off-by: stephen <[email protected]> (cherry picked from commit 3b8e683) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/sql/optimizer/statistics/ExpressionStatisticCalculator.java
Signed-off-by: stephen <[email protected]> (cherry picked from commit 3b8e683)
…52683) (#52696) Co-authored-by: stephen <[email protected]>
…52683) (#52695) Co-authored-by: stephen <[email protected]>
…52683) Signed-off-by: stephen <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Why I'm doing:
The current nullsFraction method for concat calculation is incorrect and may be negative. This will cause the cardinality of the join node to be 1.
What I'm doing:
Reference binaryExpressionCalculate nullsFraction algorithm is
1 - ((1 - left.getNullsFraction ()) * ( 1 - right.getNullsFraction ()))
. Fix multiaryExpressionCalculateFixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: