Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
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;


/**
Expand All @@ -36,7 +36,7 @@
**/
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;
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public void testNormal() throws UserException {
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);
Expand Down