EmmyMiao87 commented on a change in pull request #8202:
URL: https://github.com/apache/incubator-doris/pull/8202#discussion_r816409256
##########
File path: docs/en/sql-reference/sql-statements/Data Manipulation/SHOW EXPORT.md
##########
@@ -61,6 +61,9 @@ Explain:
5. Show the export task of specifying dB and label
SHOW EXPORT FROM example_db WHERE LABEL = "mylabel";
+6. Show the export task of specifying dB and label prefix is "labelprefix"
Review comment:
```suggestion
6. Show the export task of specifying DB and label prefix is "labelprefix"
```
##########
File path: docs/zh-CN/sql-reference/sql-statements/Data Manipulation/SHOW
EXPORT.md
##########
@@ -61,6 +61,9 @@ under the License.
5. 展示指定db,指定label的导出任务
SHOW EXPORT FROM example_db WHERE LABEL = "mylabel";
+ 6. 展示指定db,label中前缀是labelprefix的导出任务
Review comment:
```suggestion
6. 展示指定 db,label 中前缀是 labelprefix 的导出任务
```
##########
File path: docs/en/sql-reference/sql-statements/Data Manipulation/SHOW EXPORT.md
##########
@@ -61,6 +61,9 @@ Explain:
5. Show the export task of specifying dB and label
Review comment:
```suggestion
5. Show the export task of specifying DB and label
```
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/analysis/ShowExportStmt.java
##########
@@ -132,82 +137,47 @@ private void analyzePredicate(Expr whereExpr) throws
AnalysisException {
return;
}
- boolean valid = true;
- boolean hasJobId = false;
- boolean hasState = false;
- boolean hasLabel = false;
-
- CHECK: {
- // check predicate type
- if (whereExpr instanceof BinaryPredicate) {
- BinaryPredicate binaryPredicate = (BinaryPredicate) whereExpr;
- if (binaryPredicate.getOp() != Operator.EQ) {
- valid = false;
- break CHECK;
- }
- } else {
- valid = false;
- break CHECK;
- }
-
- // left child
- if (!(whereExpr.getChild(0) instanceof SlotRef)) {
- valid = false;
- break CHECK;
- }
- String leftKey = ((SlotRef) whereExpr.getChild(0)).getColumnName();
- if (leftKey.equalsIgnoreCase("id")) {
- hasJobId = true;
- } else if (leftKey.equalsIgnoreCase("state")) {
- hasState = true;
- } else if (leftKey.equalsIgnoreCase("label")) {
- hasLabel = true;
- } else {
- valid = false;
- break CHECK;
- }
-
- // right child
- if (hasState) {
- if (!(whereExpr.getChild(1) instanceof StringLiteral)) {
- valid = false;
- break CHECK;
+ boolean valid = false;
+
+ // enumerate all possible conditions
+ if (whereExpr.getChild(0) instanceof SlotRef) {
Review comment:
Could you please add some test
--
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]