public LogicalPlan createPlan(Session session, Expr expr, boolean debug) throws PlanningException {
LogicalPlan plan = new LogicalPlan(session.getCurrentDatabase(), this);
QueryBlock rootBlock = plan.newAndGetBlock(LogicalPlan.ROOT_BLOCK);
PreprocessContext preProcessorCtx = new PreprocessContext(session, plan, rootBlock);
preprocessor.visit(preProcessorCtx, new Stack<Expr>(), expr);
PlanContext context = new PlanContext(session, plan, plan.getRootBlock(), debug);
LogicalNode topMostNode = this.visit(context, new Stack<Expr>(), expr);