if (node.getWhere().isPresent()) {
Expression predicate = node.getWhere().get();
Analyzer.verifyNoAggregatesOrWindowFunctions(metadata, predicate, "WHERE");
ExpressionAnalysis expressionAnalysis = Analyzer.analyzeExpression(session, metadata, tupleDescriptor, analysis, experimentalSyntaxEnabled, context, predicate);
analysis.addInPredicates(node, expressionAnalysis.getSubqueryInPredicates());
if (expressionAnalysis.getType() != Type.BOOLEAN && expressionAnalysis.getType() != Type.NULL) {
throw new SemanticException(TYPE_MISMATCH, predicate, "WHERE clause must evaluate to a boolean: actual type %s", expressionAnalysis.getType());
}
analysis.setWhere(node, predicate);
}
}