Package org.voltdb.plannodes

Examples of org.voltdb.plannodes.AbstractPlanNode


        Procedure catalog_proc = this.getProcedure("JoinProjection");
        Statement catalog_stmt = this.getStatement(catalog_proc, "sql");
        this.check(catalog_stmt);

        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
        //validateNodeColumnOffsets(root);
       
        // Grab the single-partition root node and make sure that they have the same
        // output columns in their topmost send node
        AbstractPlanNode spRoot = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(spRoot);
       
        assertEquals(root.getOutputColumnGUIDCount(), spRoot.getOutputColumnGUIDCount());
        PlannerContext context = PlannerContext.singleton();
        assertNotNull(context);
        for (int i = 0, cnt = root.getOutputColumnGUIDCount(); i < cnt; i++) {
            Integer guid0 = root.getOutputColumnGUID(i);
            PlanColumn col0 = context.get(guid0);
            assertNotNull(col0);
           
            Integer guid1 = spRoot.getOutputColumnGUID(i);
            PlanColumn col1 = context.get(guid1);
            assertNotNull(col1);
           
            assertTrue(col0.equals(col1, false, true));
        } // FOR
View Full Code Here


        Statement catalog_stmt = this.getStatement(catalog_proc, "sql");
        this.check(catalog_stmt);

        // Grab the root node of the multi-partition query plan tree for this
        // Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
       
        // We should have two LIMITs and two ORDER BYs
        Class<?> planClasses[] = { LimitPlanNode.class, OrderByPlanNode.class };
        for (Class<?> c : planClasses) {
View Full Code Here

        };
       
        Procedure catalog_proc = this.getProcedure(UpdateLocation.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "update");

        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
        Collection<ExpressionType> result = PlanNodeUtil.getScanExpressionTypes(root);
        assertNotNull(result);
        assertFalse(result.isEmpty());
        for (ExpressionType e : expected) {
View Full Code Here

        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_CALL_FORWARDING);
        Column expected[] = {
            this.getColumn(catalog_tbl, "S_ID")
        };
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
       
        Collection<Column> columns = PlanNodeUtil.getOutputColumnsForPlanNode(catalog_db, root.getChild(0));
        assertNotNull(columns);
//        System.err.print(catalog_stmt.fullName() + ": " + CatalogUtil.debug(columns));
//        System.err.println(PlanNodeUtil.debug(root));
        assertEquals(catalog_stmt.fullName(), expected.length, columns.size());
        for (int i = 0; i < expected.length; i++) {
View Full Code Here

        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column expected[] = {
            this.getColumn(catalog_tbl, "VLR_LOCATION")
        };
       
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
        IndexScanPlanNode idx_node = CollectionUtil.first(PlanNodeUtil.getPlanNodes(root, IndexScanPlanNode.class));
        assertNotNull(idx_node);
       
        Collection<Column> columns = PlanNodeUtil.getUpdatedColumnsForPlanNode(catalog_db, idx_node);
View Full Code Here

    /**
     * testGetPlanNodes
     */
    public void testGetPlanNodes() throws Exception {
        PlannerContext cntxt = new PlannerContext();
        AbstractPlanNode root_node = new ProjectionPlanNode(cntxt, 1);
        root_node.addAndLinkChild(new SeqScanPlanNode(cntxt, 2));
       
        Collection<SeqScanPlanNode> found0 = PlanNodeUtil.getPlanNodes(root_node, SeqScanPlanNode.class);
        assertFalse(found0.isEmpty());
       
        Collection<AbstractScanPlanNode> found1 = PlanNodeUtil.getPlanNodes(root_node, AbstractScanPlanNode.class);
View Full Code Here

   
    /**
     * testGetTableReferences
     */
    public void testGetTableReferences() throws Exception {
        AbstractPlanNode root_node = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root_node);
       
        Collection<AbstractPlanNode> found = PlanNodeUtil.getPlanNodesReferencingTable(root_node, catalog_tbl);
        assertEquals(1, found.size());
        AbstractPlanNode node = CollectionUtil.first(found);
        assertNotNull(node);
        assertTrue(node instanceof AbstractScanPlanNode);
    }
View Full Code Here

        Set<AbstractPlanNode> all_nodes = new HashSet<AbstractPlanNode>();
       
        for (PlanFragment catalog_frag : fragments) {
            assertNotNull(catalog_frag);
            final Set<AbstractPlanNode> nodes = new HashSet<AbstractPlanNode>();
            AbstractPlanNode root = PlanNodeUtil.getPlanNodeTreeForPlanFragment(catalog_frag);
            assertNotNull(nodes);
            new PlanNodeTreeWalker(true) {
                @Override
                protected void callback(AbstractPlanNode element) {
                    nodes.add(element);
View Full Code Here

    public void testAddTableColumn() throws Exception {
        Procedure catalog_proc = this.getProcedure("SingleProjection");
        Statement catalog_stmt = this.getStatement(catalog_proc, "sql");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode rootNode = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        PlanOptimizerUtil.populateTableNodeInfo(state, rootNode);
       
        // check two hashmaps contain what we expect
        checkPlanNodeColumns(state.planNodeColumns);
        checkTableColumns(state.tableColumns);
View Full Code Here

    public void testPopulateTableNodeInfo() throws Exception {
        Procedure catalog_proc = this.getProcedure("SingleProjection");
        Statement catalog_stmt = this.getStatement(catalog_proc, "sql");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode rootNode = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        PlanOptimizerUtil.populateTableNodeInfo(state, rootNode);
       
        // check two hashmaps contain what we expect
        checkPlanNodeColumns(state.planNodeColumns);
        checkTableColumns(state.tableColumns);
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.