Search in sources :

Example 6 with TableCountPlanNode

use of org.voltdb.plannodes.TableCountPlanNode in project voltdb by VoltDB.

the class TestPlansCount method testCountStar000.

// DOES NOT support the cases down below right now
// This is treated as new TABLE COUNT plan for replicated table
public void testCountStar000() {
    List<AbstractPlanNode> pn = compileToFragments("SELECT count(*) from T1");
    AbstractPlanNode p = pn.get(0).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
    pn = compileToFragments("SELECT count(1) from T1");
    p = pn.get(0).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) TableCountPlanNode(org.voltdb.plannodes.TableCountPlanNode)

Example 7 with TableCountPlanNode

use of org.voltdb.plannodes.TableCountPlanNode in project voltdb by VoltDB.

the class TestPlansCount method testCountStar004.

public void testCountStar004() {
    List<AbstractPlanNode> pn = compileToFragments("select count(*) from (SELECT count(*) from P1) Temp");
    AbstractPlanNode p = pn.get(0).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
    p = p.getChild(0);
    assertTrue(p instanceof AggregatePlanNode);
    p = pn.get(1).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
    pn = compileToFragments("select count(1) from (SELECT count(1) from P1) Temp");
    p = pn.get(0).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
    p = p.getChild(0);
    assertTrue(p instanceof AggregatePlanNode);
    p = pn.get(1).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) AggregatePlanNode(org.voltdb.plannodes.AggregatePlanNode) TableCountPlanNode(org.voltdb.plannodes.TableCountPlanNode)

Example 8 with TableCountPlanNode

use of org.voltdb.plannodes.TableCountPlanNode in project voltdb by VoltDB.

the class TestPlansCount method testCountStar001.

// This is treated as new TABLE COUNT plan for partitioned table
public void testCountStar001() {
    List<AbstractPlanNode> pn = compileToFragments("SELECT count(*) from P1");
    AbstractPlanNode p = pn.get(0).getChild(0);
    // AGGREGATE_SUM
    assertTrue(p instanceof AggregatePlanNode);
    p = pn.get(1).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
    pn = compileToFragments("SELECT count(1) from P1");
    p = pn.get(0).getChild(0);
    // AGGREGATE_SUM
    assertTrue(p instanceof AggregatePlanNode);
    p = pn.get(1).getChild(0);
    assertTrue(p instanceof TableCountPlanNode);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) AggregatePlanNode(org.voltdb.plannodes.AggregatePlanNode) TableCountPlanNode(org.voltdb.plannodes.TableCountPlanNode)

Aggregations

AbstractPlanNode (org.voltdb.plannodes.AbstractPlanNode)8 TableCountPlanNode (org.voltdb.plannodes.TableCountPlanNode)8 AggregatePlanNode (org.voltdb.plannodes.AggregatePlanNode)5 ProjectionPlanNode (org.voltdb.plannodes.ProjectionPlanNode)2 ArrayList (java.util.ArrayList)1 Index (org.voltdb.catalog.Index)1 AbstractExpression (org.voltdb.expressions.AbstractExpression)1 AbstractScanPlanNode (org.voltdb.plannodes.AbstractScanPlanNode)1 HashAggregatePlanNode (org.voltdb.plannodes.HashAggregatePlanNode)1 IndexCountPlanNode (org.voltdb.plannodes.IndexCountPlanNode)1 IndexScanPlanNode (org.voltdb.plannodes.IndexScanPlanNode)1 MergeReceivePlanNode (org.voltdb.plannodes.MergeReceivePlanNode)1 ReceivePlanNode (org.voltdb.plannodes.ReceivePlanNode)1 SeqScanPlanNode (org.voltdb.plannodes.SeqScanPlanNode)1 ExpressionType (org.voltdb.types.ExpressionType)1