@Override public void meet(SqlLowerCase node) throws RuntimeException { super.meet(node); if (node.getArg() instanceof SqlNull) { replace(node, new SqlNull()); } else if (node.getArg() instanceof SqlConstant) { SqlConstant arg = (SqlConstant) node.getArg(); String lower = arg.getValue().toString().toLowerCase(Locale.US); replace(node, str(lower)); } }
@Override public void meet(SqlEq node) throws RuntimeException { super.meet(node); SqlExpr left = node.getLeftArg(); SqlExpr right = node.getRightArg(); if (left instanceof SqlNull || right instanceof SqlNull) { replace(node, new SqlNull()); } else if (left instanceof SqlConstant<?> && right instanceof SqlConstant<?>) { SqlConstant<?> l = (SqlConstant<?>) left; SqlConstant<?> r = (SqlConstant<?>) right; if (l.getValue().equals(r.getValue())) { replace(node, new TrueValue()); } else { replace(node, new FalseValue()); } } }