This is an automated email from the ASF dual-hosted git repository. yiguolei 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 161d134270 [bugfix](load) fix cancel load stmt cannot recognize key words in upper case (#11906) 161d134270 is described below commit 161d1342707d932f14630c5bcb5df42e82e32a67 Author: Zhengguo Yang <yangz...@gmail.com> AuthorDate: Sun Aug 21 10:03:10 2022 +0800 [bugfix](load) fix cancel load stmt cannot recognize key words in upper case (#11906) --- .../src/main/java/org/apache/doris/analysis/CancelLoadStmt.java | 8 +++++--- .../test/java/org/apache/doris/analysis/CancelLoadStmtTest.java | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelLoadStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelLoadStmt.java index 7af21948b5..263b66cf31 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelLoadStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelLoadStmt.java @@ -23,10 +23,10 @@ import org.apache.doris.common.AnalysisException; import org.apache.doris.common.UserException; import com.google.common.base.Strings; -import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import lombok.Getter; -import java.util.List; +import java.util.Set; /** @@ -36,7 +36,7 @@ import java.util.List; **/ public class CancelLoadStmt extends DdlStmt { - private static final List<String> SUPPORT_COLUMNS = Lists.newArrayList("label", "state"); + private static final Set<String> SUPPORT_COLUMNS = Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER); @Getter private String dbName; @@ -55,6 +55,8 @@ public class CancelLoadStmt extends DdlStmt { public CancelLoadStmt(String dbName, Expr whereClause) { this.dbName = dbName; this.whereClause = whereClause; + this.SUPPORT_COLUMNS.add("label"); + this.SUPPORT_COLUMNS.add("state"); } private void checkColumn(Expr expr, boolean like) throws AnalysisException { diff --git a/fe/fe-core/src/test/java/org/apache/doris/analysis/CancelLoadStmtTest.java b/fe/fe-core/src/test/java/org/apache/doris/analysis/CancelLoadStmtTest.java index 3521a88f44..f2e9a39a63 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/analysis/CancelLoadStmtTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/analysis/CancelLoadStmtTest.java @@ -67,6 +67,14 @@ public class CancelLoadStmtTest extends TestWithFeService { Assertions.assertEquals("CANCEL LOAD FROM default_cluster:testDb WHERE `label` = 'doris_test_label'", stmt.toString()); + SlotRef labelSlotRefUpper = new SlotRef(null, "LABEL"); + BinaryPredicate labelBinaryPredicateUpper = new BinaryPredicate(BinaryPredicate.Operator.EQ, labelSlotRefUpper, + labelStringLiteral); + CancelLoadStmt stmtUpper = new CancelLoadStmt(null, labelBinaryPredicateUpper); + stmtUpper.analyze(analyzer); + Assertions.assertEquals("CANCEL LOAD FROM default_cluster:testDb WHERE `LABEL` = 'doris_test_label'", + stmtUpper.toString()); + BinaryPredicate stateBinaryPredicate = new BinaryPredicate(BinaryPredicate.Operator.EQ, stateSlotRef, stateStringLiteral); stmt = new CancelLoadStmt(null, stateBinaryPredicate); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org