Code review comment: You forget to add 'IndexName=xxx' example

Code before review:
private void analyzeSubPredicate(Expr subExpr) throws AnalysisException {
if (subExpr == null) {
return;
}
if (subExpr instanceof CompoundPredicate) {
CompoundPredicate cp = (CompoundPredicate) subExpr;
if (cp.getOp() != org.apache.doris.analysis.CompoundPredicate.Operator.AND) {
throw new AnalysisException("Only allow compound predicate with operator AND");
}
analyzeSubPredicate(cp.getChild(0));
analyzeSubPredicate(cp.getChild(1));
return;
}
boolean valid = true;
do {
if (!(subExpr instanceof  BinaryPredicate)) {
valid = false;
break;
}
BinaryPredicate binaryPredicate = (BinaryPredicate) subExpr;
if (binaryPredicate.getOp() != BinaryPredicate.Operator.EQ) {
valid = false;
break;
}
if (!(subExpr.getChild(0) instanceof SlotRef)) {
valid = false;
break;
}
String leftKey = ((SlotRef) subExpr.getChild(0)).getColumnName();
if (leftKey.equalsIgnoreCase("version")) {
if (!(subExpr.getChild(1) instanceof IntLiteral) || version > -1) {
valid = false;
break;
}
version = ((IntLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("backendid")) {
if (!(subExpr.getChild(1) instanceof IntLiteral) || backendId > -1) {
valid = false;
break;
}
backendId = ((IntLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("indexname")) {
if (!(subExpr.getChild(1) instanceof StringLiteral) || indexName != null) {
valid = false;
break;
}
indexName = ((StringLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("state")) {
if (!(subExpr.getChild(1) instanceof StringLiteral) || replicaState != null) {
valid = false;
break;
}
String state = ((StringLiteral) subExpr.getChild(1)).getValue().toUpperCase();
try {
replicaState = Replica.ReplicaState.valueOf(state);
} catch (Exception e) {
replicaState = null;
valid = false;
break;
}
} else {
valid = false;
break;
}
} while(false);
if (!valid) {
throw new AnalysisException("Where clause should looks like: Version = \"version\","
+ " State = \"NORMAL|ROLLUP|CLONE|DECOMMISSION\", or BackendId = 10000"
+ " or compound predicate with operator AND");
}
}

Line under review: + " or compound predicate with operator AND");

Code after addressing the review:
private void analyzeSubPredicate(Expr subExpr) throws AnalysisException {
if (subExpr == null) {
return;
}
if (subExpr instanceof CompoundPredicate) {
CompoundPredicate cp = (CompoundPredicate) subExpr;
if (cp.getOp() != org.apache.doris.analysis.CompoundPredicate.Operator.AND) {
throw new AnalysisException("Only allow compound predicate with operator AND");
}
analyzeSubPredicate(cp.getChild(0));
analyzeSubPredicate(cp.getChild(1));
return;
}
boolean valid = true;
do {
if (!(subExpr instanceof  BinaryPredicate)) {
valid = false;
break;
}
BinaryPredicate binaryPredicate = (BinaryPredicate) subExpr;
if (binaryPredicate.getOp() != BinaryPredicate.Operator.EQ) {
valid = false;
break;
}
if (!(subExpr.getChild(0) instanceof SlotRef)) {
valid = false;
break;
}
String leftKey = ((SlotRef) subExpr.getChild(0)).getColumnName();
if (leftKey.equalsIgnoreCase("version")) {
if (!(subExpr.getChild(1) instanceof IntLiteral) || version > -1) {
valid = false;
break;
}
version = ((IntLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("backendid")) {
if (!(subExpr.getChild(1) instanceof IntLiteral) || backendId > -1) {
valid = false;
break;
}
backendId = ((IntLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("indexname")) {
if (!(subExpr.getChild(1) instanceof StringLiteral) || indexName != null) {
valid = false;
break;
}
indexName = ((StringLiteral) subExpr.getChild(1)).getValue();
} else if (leftKey.equalsIgnoreCase("state")) {
if (!(subExpr.getChild(1) instanceof StringLiteral) || replicaState != null) {
valid = false;
break;
}
String state = ((StringLiteral) subExpr.getChild(1)).getValue().toUpperCase();
try {
replicaState = Replica.ReplicaState.valueOf(state);
} catch (Exception e) {
replicaState = null;
valid = false;
break;
}
} else {
valid = false;
break;
}
} while(false);
if (!valid) {
throw new AnalysisException("Where clause should looks like: Version = \"version\","
+ " or state = \"NORMAL|ROLLUP|CLONE|DECOMMISSION\", or BackendId = 10000,"
+ " indexname=\"rollup_name\" or compound predicate with operator AND");
}
}