Package org.voltdb.catalog

Examples of org.voltdb.catalog.Statement


    /**
     * testProjectionPushdownDistinctOffset
     */
    public void testProjectionPushdownDistinctOffset() throws Exception {
        Procedure catalog_proc = this.getProcedure(slev.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetStockCount");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
       
View Full Code Here


    /**
     * testProjectionPushdown
     */
    public void testProjectionPushdown() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "getCustomer");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
       
View Full Code Here

    /**
     * testInlineProjectionColumns
     */
    public void testInlineProjectionColums() throws Exception {
        Procedure catalog_proc = this.getProcedure(slev.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetStockCount");
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
       
        // Make sure the bottom-most IndexScan has an inline projection with the right columns
View Full Code Here

    /**
     * testAggregatePushdown
     */
    public void testAggregatePushdown() throws Exception {
        Procedure catalog_proc = this.getProcedure(slev.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetStockCount");

        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
       
View Full Code Here

    }

    protected final Statement getStatement(Database catalog_db, Procedure catalog_proc, String stmt_name) {
        assertNotNull(catalog_db);
        assertNotNull(catalog_proc);
        Statement catalog_stmt = catalog_proc.getStatements().getIgnoreCase(stmt_name);
        assert(catalog_stmt != null) : "Failed to retrieve Statement '" + stmt_name + "' from Procedure '" + catalog_proc.getName() + "'";
        return (catalog_stmt);
    }
View Full Code Here

            BatchPlanner batchPlan = new BatchPlanner(batch[batch_idx], catalog_proc, p_estimator);
            BatchPlanner.BatchPlan plan = batchPlan.plan(TXN_ID, BASE_PARTITION, all_partitions, this.touched_partitions, args[batch_idx]);
            assertNotNull(plan);
            assertFalse(plan.hasMisprediction());
           
            Statement catalog_stmts[] = batchPlan.getStatements();
            assertNotNull(catalog_stmts);
            assertEquals(query_batch[batch_idx].size(), catalog_stmts.length);
           
            PartitionSet partitions[] = plan.getStatementPartitions();
            assertNotNull(partitions);
View Full Code Here

    /**
     * testReplicatedTableTouchedPartitions
     */
    public void testReplicatedTableTouchedPartitions() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "getItemInfo");
       
        SQLStmt batch[] = { new SQLStmt(catalog_stmt) };
        ParameterSet params[] = new ParameterSet[]{
                VoltProcedure.getCleanParams(batch[0], new Object[]{ new Long(1) })
        };
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp(ProjectType.TPCC);
        this.addPartitions(NUM_PARTITIONS);
       
        this.catalog_proc = this.getProcedure(TARGET_PROC);
        Statement catalog_stmts[] = new Statement[TARGET_STMTS.length];
        for (int i = 0; i < catalog_stmts.length; i++) {
            catalog_stmts[i] = this.getStatement(catalog_proc, TARGET_STMTS[i]);
        } // FOR
       
        this.batchStmts = new SQLStmt[TARGET_REPEAT * TARGET_STMTS.length];
 
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp(ProjectType.SEATS);
        this.initializeCatalog(NUM_HOSTS, NUM_SITES, NUM_PARTITIONS);

        Procedure catalog_proc = this.getProcedure(TARGET_PREFETCH_PROCEDURE);
        Statement catalog_stmt = this.getStatement(catalog_proc, TARGET_PREFETCH_STATEMENT);
        catalog_stmt.setPrefetchable(true);
        catalog_proc.setPrefetchable(true);
       
        final ParameterSet params = new ParameterSet(this.proc_params);
        final EstimatorState estState = new MarkovEstimatorState.Factory(catalogContext).makeObject();
        estState.addPrefetchableStatement(new CountedStatement(catalog_stmt, 0));

        // Hard-code ParameterMapping
        int mappings[][] = {
            // StmtParameter -> ProcParameter
            { 0, 1 },
        };
        List<ProcParameter> procParams = CatalogUtil.getSortedCatalogItems(catalog_proc.getParameters(), "index");
        List<StmtParameter> stmtParams = CatalogUtil.getSortedCatalogItems(catalog_stmt.getParameters(), "index");
        assertNotNull(stmtParams);
        assertEquals(catalog_stmt.getParameters().size(), mappings.length);
        for (int m[] : mappings) {
            stmtParams.get(m[0]).setProcparameter(procParams.get(m[1]));
        } // FOR

        assertNotNull(catalogContext.paramMappings);
View Full Code Here

    /**
     * testGetPlanFragment
     */
    public void testGetPlanFragment() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = CollectionUtil.first(catalog_proc.getStatements());
        assert (catalog_stmt != null);

        for (PlanFragment expected : catalog_stmt.getFragments()) {
            int id = expected.getId();
            PlanFragment actual = CatalogUtil.getPlanFragment(expected, id);
            assertNotNull(actual);
            assertEquals(expected, actual);
        } // FOR
        for (PlanFragment expected : catalog_stmt.getMs_fragments()) {
            int id = expected.getId();
            PlanFragment actual = CatalogUtil.getPlanFragment(expected, id);
            assertNotNull(actual);
            assertEquals(expected, actual);
        } // FOR
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Statement

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.