Package com.foundationdb.sql.optimizer.rule

Examples of com.foundationdb.sql.optimizer.rule.ASTStatementLoader


            throw new SQLParserInternalException(e);
        }
        StoreAdapter adapter = store().createAdapter(session, SchemaCache.globalSchema(ais));
        CreateAsCompiler compiler = new CreateAsCompiler(server, adapter, false, ais);
        PlanContext plan = new PlanContext(compiler);
        ASTStatementLoader astStatementLoader = new ASTStatementLoader();
        AISBinder binder = new AISBinder(ais, table.getName().getSchemaName());
        try {
            binder.bind(stmt);
            BooleanNormalizer booleanNormalizer = new BooleanNormalizer(parser);
            stmt = booleanNormalizer.normalize(stmt);
            SubqueryFlattener subqueryFlattener = new SubqueryFlattener(parser);
            stmt = subqueryFlattener.flatten((DMLStatementNode)stmt);
        } catch (StandardException ex) {
            throw new SQLParserInternalException(ex);
        }
        plan.setPlan(new AST((DMLStatementNode)stmt, null));
        astStatementLoader.apply(plan);

        List<TableName> tableNames = new ArrayList<>();
        Deque<PlanNode> nodeQueue = new LinkedList<>();
        nodeQueue.add(plan.getPlan());
        while(!nodeQueue.isEmpty()){
View Full Code Here


        // Turn parsed AST into intermediate form.
        PlanNode plan = new AST((DMLStatementNode)stmt, parser.getParameterList());
        {
            RulesTestContext rulesContext =
                RulesTestContext.create(ais, null, false,
                                        Collections.<BaseRule>singletonList(new ASTStatementLoader()), new Properties());
            PlanContext planContext = new PlanContext(rulesContext, plan);
            rulesContext.applyRules(planContext);
            plan = planContext.getPlan();
        }
        PlanNode duplicate = (PlanNode)plan.duplicate();
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.rule.ASTStatementLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.