xiedeyantu commented on code in PR #32732:
URL: https://github.com/apache/doris/pull/32732#discussion_r1537109887
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDataSkewStmt.java:
##########
@@ -58,9 +63,23 @@ public void analyze(Analyzer analyzer) throws UserException {
ConnectContext.get().getRemoteIP(),
tblRef.getName().getDb() + "." +
tblRef.getName().getTbl());
}
+
+ Optional<DatabaseIf> db =
Env.getCurrentEnv().getCurrentCatalog().getDb(tblRef.getName().getDb());
+ if (!db.isPresent()) {
+ throw new AnalysisException("Can not find db: " +
tblRef.getName().getDb());
+ }
+ Optional<TableIf> tbl = db.get().getTable(tblRef.getName().getTbl());
+ if (!tbl.isPresent()) {
+ throw new AnalysisException("Can not find table: " +
tblRef.getName().getDb() + "."
+ + tblRef.getName().getTbl());
+ }
+
PartitionNames partitionNames = tblRef.getPartitionNames();
- if (partitionNames == null ||
partitionNames.getPartitionNames().size() != 1) {
- throw new AnalysisException("Should specify one and only one
partition");
+ if (partitionNames == null) {
+ if (tbl.get().getPartitionNames().isEmpty()) {
+ throw new AnalysisException("Can not find any partition");
+ }
+ tblRef.setPartitionNames(new PartitionNames(false, new
ArrayList<>(tbl.get().getPartitionNames())));
Review Comment:
> do you think we should we also show tempPartitions? getPartitionNames()
does not handle tempPartitions.
@rohitrs1983 OK, I will add both later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]