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 and refactor logical of inference bucket number #26726

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

murphyatwork
Copy link
Contributor

@murphyatwork murphyatwork commented Jul 7, 2023

Fixes #issue

  1. Unify the bucket number inference code to Table::inferDistribution
  2. Not change default bucket number, so show create table would not display the bucket number if not specified manually

What type of PR is this:

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

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • 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

if (base.getTable().isNativeTableOrMaterializedView()) {
OlapTable olapTable = (OlapTable) base.getTable();
DistributionInfo dist = olapTable.getDefaultDistributionInfo();
inferredBucketNum = Math.max(inferredBucketNum, dist.getBucketNum());
Copy link
Contributor

Choose a reason for hiding this comment

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

The base table bucket number may be too larger for MV?
If the data can aggregated to 10x times, the bucket number in the base table is not suitable for the MV

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i know, but it's better than now

ABingHuang
ABingHuang previously approved these changes Jul 10, 2023
Signed-off-by: Murphy <mofei@starrocks.com>
Signed-off-by: Murphy <mofei@starrocks.com>
Signed-off-by: Murphy <mofei@starrocks.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 8 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage Check]

😍 pass : 22 / 22 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/catalog/MaterializedView.java 12 12 100.00% []
🔵 com/starrocks/server/OlapTableFactory.java 1 1 100.00% []
🔵 com/starrocks/catalog/OlapTable.java 4 4 100.00% []
🔵 com/starrocks/server/LocalMetastore.java 5 5 100.00% []

@murphyatwork murphyatwork enabled auto-merge (squash) July 11, 2023 07:49
@murphyatwork murphyatwork merged commit c9e9dad into StarRocks:main Jul 12, 2023
@murphyatwork
Copy link
Contributor Author

@Mergifyio backport branch-3.1

@mergify
Copy link
Contributor

mergify bot commented Jul 12, 2023

backport branch-3.1

✅ Backports have been created

@github-actions github-actions bot added the 3.1 label Jul 12, 2023
mergify bot pushed a commit that referenced this pull request Jul 12, 2023
1. Unify the bucket number inference code to `Table::inferDistribution`
2. Not change default bucket number, so `show create table` would not
display the bucket number if not specified manually

(cherry picked from commit c9e9dad)

# Conflicts:
#	test/sql/test_materialized_view/R/test_create
#	test/sql/test_materialized_view/R/test_show_materialized_view
wanpengfei-git pushed a commit that referenced this pull request Jul 12, 2023
1. Unify the bucket number inference code to `Table::inferDistribution`
2. Not change default bucket number, so `show create table` would not
display the bucket number if not specified manually

(cherry picked from commit c9e9dad)

# Conflicts:
#	test/sql/test_materialized_view/R/test_create
#	test/sql/test_materialized_view/R/test_show_materialized_view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants