} else if (expression instanceof CaseExpression) {
expression = rewriteCaseExpression((CaseExpression)expression);
} else if (expression instanceof SearchedCaseExpression) {
expression = rewriteCaseExpression((SearchedCaseExpression)expression);
} else if (expression instanceof ScalarSubquery) {
ScalarSubquery subquery = (ScalarSubquery)expression;
if (subquery.shouldEvaluate() && processing) {
return new Constant(evaluator.evaluate(subquery, null), subquery.getType());
}
rewriteSubqueryContainer(subquery, true);
if (!RelationalNodeUtil.shouldExecute(subquery.getCommand(), false, true)) {
return new Constant(null, subquery.getType());
}
if (subquery.getCommand().getProcessorPlan() == null) {
addImplicitLimit(subquery, 2);
}
return expression;
} else if (expression instanceof ExpressionSymbol) {
if (expression instanceof AggregateSymbol) {