This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 42defe673a1 [fix](cloud) fix analyze compound predicate exception when
show copy (#37656)
42defe673a1 is described below
commit 42defe673a13426cf46d5ecb532d7676731c93b1
Author: hui lai <[email protected]>
AuthorDate: Fri Jul 12 10:00:38 2024 +0800
[fix](cloud) fix analyze compound predicate exception when show copy
(#37656)
Bug report:
```
mysql> show copy where id='e66c0eb7372b4c80-8781ffff29e0fd85' and tablename
='test_delete_on' and files like 'test_delete_on.json' and state='finished'\G
ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception:
class org.apache.doris.analysis.CompoundPredicate cannot be cast to class
org.apache.doris.analysis.SlotRef (org.apache.doris.analysis.CompoundPredicate
and org.apache.doris.analysis.SlotRef are in unnamed module of loader 'app')
```
---
.../src/main/java/org/apache/doris/analysis/ShowCopyStmt.java | 2 +-
.../src/main/java/org/apache/doris/analysis/ShowLoadStmt.java | 10 +---------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCopyStmt.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCopyStmt.java
index 6a88cfb7ea0..0d4ba6a909e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCopyStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCopyStmt.java
@@ -197,7 +197,7 @@ public class ShowCopyStmt extends ShowLoadStmt {
}
}
- protected void analyzeCompoundPredicate(Expr expr, List<Expr> exprs)
throws AnalysisException {
+ private void analyzeCompoundPredicate(Expr expr, List<Expr> exprs) throws
AnalysisException {
if (expr instanceof CompoundPredicate) {
CompoundPredicate cp = (CompoundPredicate) expr;
if (cp.getOp() != CompoundPredicate.Operator.AND) {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowLoadStmt.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowLoadStmt.java
index d56a1613bbd..b08ef917ab3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowLoadStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowLoadStmt.java
@@ -164,15 +164,7 @@ public class ShowLoadStmt extends ShowStmt {
// analyze where clause if not null
if (whereClause != null) {
if (whereClause instanceof CompoundPredicate) {
- CompoundPredicate cp = (CompoundPredicate) whereClause;
- if (cp.getOp() !=
org.apache.doris.analysis.CompoundPredicate.Operator.AND) {
- throw new AnalysisException("Only allow compound predicate
with operator AND");
- }
-
- // check whether left.columnName equals to right.columnName
- checkPredicateName(cp.getChild(0), cp.getChild(1));
- analyzeSubPredicate(cp.getChild(0));
- analyzeSubPredicate(cp.getChild(1));
+ analyzeCompoundPredicate(whereClause);
} else {
analyzeSubPredicate(whereClause);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]