Package com.foundationdb.qp.exec

Examples of com.foundationdb.qp.exec.Plannable


            DMLStatementNode dmlStmt = (DMLStatementNode) stmt;
            PlanContext planContext = new PlanContext(compiler);

            BasePlannable result = compiler.compile(dmlStmt, null, planContext);

            Plannable plannable = result.getPlannable();
            QueryContext newContext = contextIfNull(context, adapter);
            getTransformCache(session, server);
            runPlan(session, newContext, schemaManager, txnService, (Operator) plannable, null);
        }finally{
            txnService.commitTransaction(session);
View Full Code Here


                                     ServerSession server,
                                     Store givenStore) {

        final ChangeLevel changeLevel = commonChangeLevel(changeSets);
        final Schema newSchema = SchemaCache.globalSchema(newAIS);
        Plannable deletePlan = null;
        Plannable insertPlan = null;
        for(ChangeSet cs : changeSets) {
            if(cs.hasSelectStatement()) {
                SQLParser parser = server.getParser();
                StatementNode insertStmt;
                try {
                    insertStmt = parser.parseStatement("insert into " + newAIS.getTable(cs.getToTableId()).getName().toStringEscaped() + " " + cs.getSelectStatement());
                } catch (StandardException e) {
                    throw new SQLParserInternalException(e);
                }
                StoreAdapter adapter = givenStore.createAdapter(session, SchemaCache.globalSchema(newAIS));
                CreateAsCompiler compiler = new CreateAsCompiler(server, adapter, true, newAIS);
                PlanContext planContext = new PlanContext(compiler);
                BasePlannable insertResult = compiler.compile((DMLStatementNode) insertStmt, null, planContext);
                insertPlan = insertResult.getPlannable();
                deletePlan = new Delete_Returning(insertPlan.getInputOperators().iterator().next(), false);
            }
            int tableID = cs.getTableId();
            TableRowType newType = newSchema.tableRowType(tableID);
            TableTransform transform = buildTableTransform(cs, changeLevel, oldAIS, newType, typesRegistry,
                                                typesTranslator, (Operator)deletePlan, (Operator)insertPlan);
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.exec.Plannable

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.