Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[improvement](show) Support that user can use show data skew statement instead of admin#7914
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,7 +17,7 @@ | ||
| package org.apache.doris.catalog; | ||
| import org.apache.doris.analysis.AdminShowDataSkewStmt; | ||
| import org.apache.doris.analysis.ShowDataSkewStmt; | ||
| import org.apache.doris.analysis.AdminShowReplicaDistributionStmt; | ||
| import org.apache.doris.analysis.AdminShowReplicaStatusStmt; | ||
| import org.apache.doris.analysis.BinaryPredicate.Operator; | ||
| @@ -247,7 +247,7 @@ private static String graph(long num, long totalNum) { | ||
| return sb.toString(); | ||
| } | ||
| public static List<List<String>> getDataSkew(AdminShowDataSkewStmt stmt) throws DdlException { | ||
| public static List<List<String>> getDataSkew(ShowDataSkewStmt stmt) throws DdlException { | ||
| return getDataSkew(stmt.getDbName(), stmt.getTblName(), stmt.getPartitionNames()); | ||
| } | ||
| @@ -257,7 +257,6 @@ private static List<List<String>> getDataSkew(String dbName, String tblName, Par | ||
| List<List<String>> result = Lists.newArrayList(); | ||
| Catalog catalog = Catalog.getCurrentCatalog(); | ||
| SystemInfoService infoService = Catalog.getCurrentSystemInfo(); | ||
| if (partitionNames == null || partitionNames.getPartitionNames().size() != 1) { | ||
| throw new DdlException("Should specify one and only one partitions"); | ||
| @@ -288,7 +287,7 @@ private static List<List<String>> getDataSkew(String dbName, String tblName, Par | ||
| List<Long> tabletIds = mIndex.getTabletIdsInOrder(); | ||
| for (int i = 0; i < tabletIds.size(); i++) { | ||
| Tablet tablet = mIndex.getTablet(tabletIds.get(i)); | ||
| long dataSize = tablet.getDataSize(false); | ||
| long dataSize = tablet.getDataSize(true); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe single replica is better ? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now,just according to the average data size column,here should compute average data size | ||
| tabletInfos.set(i, tabletInfos.get(i) + dataSize); | ||
| totalSize += dataSize; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
This name must be same as the name of document ~
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