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

[BugFix] fix to_bitmap statistics calculator #29961

Conversation

ABingHuang
Copy link
Contributor

@ABingHuang ABingHuang commented Aug 25, 2023

Fixes #29958
Fix to_bitmap function statistics calculation bug, which will lead to invalid cost and choose the wrong plan.
Fix it by modifing the average size of statistics after to_bitmap.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.1
    • 3.0
    • 2.5
    • 2.4

Signed-off-by: ABingHuang <codekhuang@163.com>
@ABingHuang ABingHuang force-pushed the issue/29958_fix_join_with_to_bitmap_rewrite_bug branch from 72fe5dd to 0c47cbb Compare August 25, 2023 09:01
Signed-off-by: ABingHuang <codekhuang@163.com>
kangkaisen
kangkaisen previously approved these changes Aug 25, 2023
@ABingHuang ABingHuang enabled auto-merge August 25, 2023 11:25
auto-merge was automatically disabled August 25, 2023 11:26

Merge queue setting changed

Signed-off-by: ABingHuang <codekhuang@163.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@wanpengfei-git
Copy link
Collaborator

[FE Incremental Coverage Report]

😍 pass : 4 / 4 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/optimizer/statistics/ExpressionStatisticCalculator.java 4 4 100.00% []

@wanpengfei-git
Copy link
Collaborator

[BE Incremental Coverage Report]

😍 pass : 0 / 0 (0%)

@ABingHuang ABingHuang enabled auto-merge (squash) August 27, 2023 14:25
@ABingHuang ABingHuang merged commit b6131a7 into StarRocks:main Aug 28, 2023
@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-3.1

@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-3.0

@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-2.5

@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2023

backport branch-3.1

✅ Backports have been created

@github-actions github-actions bot removed the 2.5 label Aug 28, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2023

backport branch-3.0

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2023

backport branch-2.5

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 28, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
(cherry picked from commit b6131a7)

# Conflicts:
#	fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewTest.java
mergify bot pushed a commit that referenced this pull request Aug 28, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
(cherry picked from commit b6131a7)

# Conflicts:
#	fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewTest.java
#	test/sql/test_materialized_view/R/test_materialized_view_force_rewrite
#	test/sql/test_materialized_view/T/test_materialized_view_force_rewrite
mergify bot pushed a commit that referenced this pull request Aug 28, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
(cherry picked from commit b6131a7)

# Conflicts:
#	fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewTest.java
ABingHuang added a commit to ABingHuang/starrocks that referenced this pull request Aug 28, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
ABingHuang added a commit that referenced this pull request Aug 28, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
ABingHuang added a commit to ABingHuang/starrocks that referenced this pull request Aug 29, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
ABingHuang added a commit that referenced this pull request Aug 29, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
Jay-ju pushed a commit to Jay-ju/starrocks that referenced this pull request Sep 7, 2023
* fix to_bitmap statistics calculator

Signed-off-by: ABingHuang <codekhuang@163.com>
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.

join with to_bitmap mv rewrite bug
6 participants