Code review comment: ```suggestion         // default format is "yyyy-MM-dd HH:mm:ss" ```

Code before review:
public Expr apply(Expr expr, Analyzer analyzer) throws AnalysisException {
if (!(expr instanceof BinaryPredicate)) {
return expr;
}
BinaryPredicate bp = (BinaryPredicate) expr;
Expr left = bp.getChild(0);
if (!(left instanceof FunctionCallExpr)) {
return expr;
}
FunctionCallExpr fce = (FunctionCallExpr) left;
if (!fce.getFnName().getFunction().equalsIgnoreCase("from_unixtime")) {
return expr;
}
FunctionParams params = fce.getParams();
if (params == null) {
return expr;
}
if (params.exprs().size() != 1 && params.exprs().size() != 2) {
return expr;
}
Expr paramSlot = params.exprs().get(0);
if (!(paramSlot instanceof SlotRef)) {
return expr;
}
SlotRef sr = (SlotRef) paramSlot;
if (!sr.getColumn().getType().isIntegerType()) {
return new BoolLiteral(false);
}
Expr right = bp.getChild(1);
if (!(right instanceof LiteralExpr)) {
return expr;
}
LiteralExpr le = (LiteralExpr) right;
SimpleDateFormat format =   new SimpleDateFormat( "yyyy-MM-dd" );
if (params.exprs().size() == 1) {
format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
} else {
LiteralExpr fm = (LiteralExpr) params.exprs().get(1);
format = new SimpleDateFormat(fm.getStringValue());
}
try {
Date date = format.parse(le.getStringValue());
if (bp.getOp() == BinaryPredicate.Operator.LT || bp.getOp() == BinaryPredicate.Operator.LE) {
BinaryPredicate r = new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
BinaryPredicate l = new BinaryPredicate(BinaryPredicate.Operator.GE, sr, LiteralExpr.create("0", Type.BIGINT));
return new CompoundPredicate(CompoundPredicate.Operator.AND, r, l);
} else if (bp.getOp() == BinaryPredicate.Operator.GT || bp.getOp() == BinaryPredicate.Operator.GE) {
BinaryPredicate l = new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
BinaryPredicate r = new BinaryPredicate(BinaryPredicate.Operator.LE, sr, LiteralExpr.create("253402271999", Type.BIGINT));
return new CompoundPredicate(CompoundPredicate.Operator.AND, r, l);
} else {
return new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
}
} catch (ParseException e) {
return expr;
}
}


Code after addressing the review:
public Expr apply(Expr expr, Analyzer analyzer) throws AnalysisException {
if (!(expr instanceof BinaryPredicate)) {
return expr;
}
BinaryPredicate bp = (BinaryPredicate) expr;
Expr left = bp.getChild(0);
if (!(left instanceof FunctionCallExpr)) {
return expr;
}
FunctionCallExpr fce = (FunctionCallExpr) left;
if (!fce.getFnName().getFunction().equalsIgnoreCase("from_unixtime")) {
return expr;
}
FunctionParams params = fce.getParams();
if (params == null) {
return expr;
}
if (params.exprs().size() != 1 && params.exprs().size() != 2) {
return expr;
}
Expr paramSlot = params.exprs().get(0);
if (!(paramSlot instanceof SlotRef)) {
return expr;
}
SlotRef sr = (SlotRef) paramSlot;
if (!sr.getColumn().getType().isIntegerType()) {
return new BoolLiteral(false);
}
Expr right = bp.getChild(1);
if (!(right instanceof LiteralExpr)) {
return expr;
}
LiteralExpr le = (LiteralExpr) right;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
if (params.exprs().size() == 1) {
format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
} else {
LiteralExpr fm = (LiteralExpr) params.exprs().get(1);
format = new SimpleDateFormat(fm.getStringValue());
}
try {
Date date = format.parse(le.getStringValue());
if (bp.getOp() == BinaryPredicate.Operator.LT || bp.getOp() == BinaryPredicate.Operator.LE) {
BinaryPredicate r = new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
BinaryPredicate l = new BinaryPredicate(BinaryPredicate.Operator.GE, sr, LiteralExpr.create("0", Type.BIGINT));
return new CompoundPredicate(CompoundPredicate.Operator.AND, r, l);
} else if (bp.getOp() == BinaryPredicate.Operator.GT || bp.getOp() == BinaryPredicate.Operator.GE) {
BinaryPredicate l = new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
BinaryPredicate r = new BinaryPredicate(BinaryPredicate.Operator.LE, sr, LiteralExpr.create("253402271999", Type.BIGINT));
return new CompoundPredicate(CompoundPredicate.Operator.AND, r, l);
} else {
return new BinaryPredicate(bp.getOp(), sr, LiteralExpr.create(String.valueOf(date.getTime() / 1000), Type.BIGINT));
}
} catch (ParseException e) {
return expr;
}
}