Package org.voltdb.plannodes

Examples of org.voltdb.plannodes.AbstractPlanNode


    /**
     * testEquals
     */
    @Test
    public void testEquals() throws Exception {
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
       
        Collection<AbstractScanPlanNode> scan_nodes = PlanNodeUtil.getPlanNodes(root, AbstractScanPlanNode.class);
        assertNotNull(scan_nodes);
        assertEquals(1, scan_nodes.size());
View Full Code Here


    /**
     * testDebug
     */
    public void testDebug() throws Exception {
        // Just make sure this doesn't throw an Exception
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
        //System.err.println(PlanNodeUtil.debug(root));
        IndexScanPlanNode scan_node = CollectionUtil.first(PlanNodeUtil.getPlanNodes(root, IndexScanPlanNode.class));
        assertNotNull(scan_node);
       
View Full Code Here

        // execute a query with the expected query plan
        Procedure proc = this.getProcedure(procName);
        Statement stmt = CollectionUtil.first(proc.getStatements());
        assertNotNull(stmt);
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(stmt, true);
        assertNotNull(root);
        Collection<?> scans = PlanNodeUtil.getPlanNodes(root, target);
        assertEquals(1, scans.size());
    }
View Full Code Here

    @Test
    public void testPlanner() throws Exception {
        Procedure catalog_proc = this.getProcedure(MockMapReduce.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, catalog_proc.getMapinputquery());
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
        System.err.println(PlanNodeUtil.debug(root));
       
        BasePlanOptimizerTestCase.validate(root);
       
View Full Code Here

        Object params[] = new Object[]{ "ABC" };
       
        Integer base_partition = new Random().nextInt(NUM_PARTITIONS);
       
        // Double check that this is always a distributed query
        AbstractPlanNode orig = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(orig);
        PartitionSet orig_partitions = new PartitionSet();
        p_estimator.getAllPartitions(orig_partitions, catalog_stmt, params, base_partition);
        assertNotNull(orig_partitions);
        assertEquals(NUM_PARTITIONS, orig_partitions.size());
View Full Code Here

public class TestPlansOrderBy extends TestCase {

    private PlannerTestAideDeCamp aide;

    private AbstractPlanNode compile(String sql, int paramCount) {
        AbstractPlanNode pn = null;
        try {
            pn =  aide.compile(sql, paramCount);
        }
        catch (NullPointerException ex) {
            // aide may throw NPE if no plangraph was created
View Full Code Here

        super.tearDown();
        aide.tearDown();
    }

    public void testOrderByOne() {
        AbstractPlanNode pn = null;
        pn = compile("SELECT * from T ORDER BY T_PKEY", 0);
        if (pn != null) {
            assertFalse(pn.findAllNodesOfType(PlanNodeType.INDEXSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.SEQSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }
View Full Code Here

            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }

    public void testOrderByTwo() {
        AbstractPlanNode pn = null;
        pn = compile("SELECT * from T ORDER BY T_PKEY, T_D1", 0);
        if (pn != null) {
            assertFalse(pn.findAllNodesOfType(PlanNodeType.INDEXSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.SEQSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }
View Full Code Here

            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }

    public void testOrderByTwoDesc() {
        AbstractPlanNode pn = null;
        pn = compile("SELECT * from T ORDER BY T_PKEY DESC, T_D1 DESC", 0);
        if (pn != null) {
            assertFalse(pn.findAllNodesOfType(PlanNodeType.INDEXSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.SEQSCAN).isEmpty());
            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }
View Full Code Here

            assertTrue(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }

    public void testOrderByTwoAscDesc() {
        AbstractPlanNode pn = null;
        pn = compile("SELECT * from T ORDER BY T_PKEY, T_D1 DESC", 0);
        if (pn != null) {
            assertTrue(pn.findAllNodesOfType(PlanNodeType.INDEXSCAN).isEmpty());
            assertFalse(pn.findAllNodesOfType(PlanNodeType.SEQSCAN).isEmpty());
            assertFalse(pn.findAllNodesOfType(PlanNodeType.ORDERBY).isEmpty());
        }
    }
View Full Code Here

TOP

Related Classes of org.voltdb.plannodes.AbstractPlanNode

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.