Code review comment: Could you add some details in this pr to explain the difference between this and the original one.

Code before review:
private void analyzeSetExprs(Analyzer analyzer) throws AnalysisException {
Set<String> columnMappingNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
for (Expr setExpr : setExprs) {
if (!(setExpr instanceof BinaryPredicate)) {
throw new AnalysisException("Set function expr only support eq binary predicate. "
+ "Expr: " + setExpr.toSql());
}
BinaryPredicate predicate = (BinaryPredicate) setExpr;
if (predicate.getOp() != BinaryPredicate.Operator.EQ) {
throw new AnalysisException("Set function expr only support eq binary predicate. "
+ "The predicate operator error, op: " + predicate.getOp());
}
Expr lhs = predicate.getChild(0);
if (!(lhs instanceof SlotRef)) {
throw new AnalysisException("Set function expr only support eq binary predicate "
+ "which's child(0) must be a column name. "
+ "The child(0) expr error. expr: " + lhs.toSql());
}
String column = ((SlotRef) lhs).getColumnName();
if (!columnMappingNames.add(column)) {
throw new AnalysisException("Duplicate column setting: " + column);
}
}
for (Expr setExpr : setExprs) {
Preconditions.checkState(setExpr instanceof BinaryPredicate);
Expr lhs = setExpr.getChild(0);
if (!(lhs instanceof SlotRef)) {
throw new AnalysisException("The left side of the set expr must be the column name");
}
lhs.analyze(analyzer);
if (((SlotRef) lhs).getColumn().isKey()) {
throw new AnalysisException("Only value columns of unique table could be updated.");
}
Expr rhs = setExpr.getChild(1);
checkLargeIntOverflow(rhs);
rhs.analyze(analyzer);
if (lhs.getType() != rhs.getType()) {
setExpr.setChild(1, rhs.checkTypeCompatibility(lhs.getType()));
}
}
}

Line under review: if (((SlotRef) lhs).getColumn().isKey()) {

Code after addressing the review:
private void analyzeSetExprs(Analyzer analyzer) throws AnalysisException {
Set<String> columnMappingNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
for (Expr setExpr : setExprs) {
if (!(setExpr instanceof BinaryPredicate)) {
throw new AnalysisException("Set function expr only support eq binary predicate. "
+ "Expr: " + setExpr.toSql());
}
BinaryPredicate predicate = (BinaryPredicate) setExpr;
if (predicate.getOp() != BinaryPredicate.Operator.EQ) {
throw new AnalysisException("Set function expr only support eq binary predicate. "
+ "The predicate operator error, op: " + predicate.getOp());
}
Expr lhs = predicate.getChild(0);
if (!(lhs instanceof SlotRef)) {
throw new AnalysisException("Set function expr only support eq binary predicate "
+ "which's child(0) must be a column name. "
+ "The child(0) expr error. expr: " + lhs.toSql());
}
String column = ((SlotRef) lhs).getColumnName();
if (!columnMappingNames.add(column)) {
throw new AnalysisException("Duplicate column setting: " + column);
}
}
for (Expr setExpr : setExprs) {
Preconditions.checkState(setExpr instanceof BinaryPredicate);
Expr lhs = setExpr.getChild(0);
if (!(lhs instanceof SlotRef)) {
throw new AnalysisException("The left side of the set expr must be the column name");
}
lhs.analyze(analyzer);
if (((SlotRef) lhs).getColumn().isKey()) {
throw new AnalysisException("Only value columns of unique table could be updated.");
}
Expr rhs = setExpr.getChild(1);
checkLargeIntOverflow(rhs);
rhs.analyze(analyzer);
if (lhs.getType() != rhs.getType()) {
setExpr.setChild(1, rhs.checkTypeCompatibility(lhs.getType()));
}
}
}