*/
public static Expression compileWhereClause(StatementContext context, FilterableStatement statement,
Set<Expression> extractedNodes) throws SQLException {
WhereExpressionCompiler whereCompiler = new WhereExpressionCompiler(context);
ParseNode where = statement.getWhere();
Expression expression = where == null ? LiteralExpression.newConstant(true,PDataType.BOOLEAN,true) : where.accept(whereCompiler);
if (whereCompiler.isAggregate()) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.AGGREGATE_IN_WHERE).build().buildException();
}
if (expression.getDataType() != PDataType.BOOLEAN) {
throw TypeMismatchException.newException(PDataType.BOOLEAN, expression.getDataType(), expression.toString());