use of org.voltdb.plannodes.AbstractPlanNode in project voltdb by VoltDB.
the class TestPlansCount method testTableCount.
public void testTableCount() {
List<AbstractPlanNode> pn = compileToFragments("SELECT count(ID) from P1");
AbstractPlanNode p = pn.get(0).getChild(0);
assertTrue(p instanceof AggregatePlanNode);
p = pn.get(1).getChild(0);
assertTrue(p instanceof TableCountPlanNode);
}
use of org.voltdb.plannodes.AbstractPlanNode in project voltdb by VoltDB.
the class TestPlansCount method testCountStar003.
// Test subquery temp table count
public void testCountStar003() {
List<AbstractPlanNode> pn = compileToFragments("select count(*) from (SELECT count(*) from T1) Temp");
AbstractPlanNode p = pn.get(0).getChild(0);
assertTrue(p instanceof TableCountPlanNode);
p = p.getChild(0);
assertTrue(p instanceof TableCountPlanNode);
pn = compileToFragments("select count(1) from (SELECT count(*) from T1) Temp");
p = pn.get(0).getChild(0);
assertTrue(p instanceof TableCountPlanNode);
p = p.getChild(0);
assertTrue(p instanceof TableCountPlanNode);
}
use of org.voltdb.plannodes.AbstractPlanNode in project voltdb by VoltDB.
the class TestPlansCount method testCountStar002.
public void testCountStar002() {
List<AbstractPlanNode> pn = compileToFragments("SELECT POINTS, count(*) from T1 Group by POINTS");
AbstractPlanNode p = pn.get(0).getChild(0);
assertTrue(p instanceof IndexScanPlanNode);
assertNotNull(p.getInlinePlanNode(PlanNodeType.AGGREGATE));
pn = compileToFragments("SELECT POINTS, count(1) from T1 Group by POINTS");
p = pn.get(0).getChild(0);
assertTrue(p instanceof IndexScanPlanNode);
assertNotNull(p.getInlinePlanNode(PlanNodeType.AGGREGATE));
}
use of org.voltdb.plannodes.AbstractPlanNode in project voltdb by VoltDB.
the class TestPlansCount method checkIndexCounter.
/**
* Check Whether or not the original plan is replaced with CountingIndexPlanNode.
*
* @param pn
* The generated plan
* @param isReplaceable
* Whether or not the original plan is replaced with CountingIndexPlanNode
*/
private void checkIndexCounter(List<AbstractPlanNode> pn, boolean isReplaceable) {
assertTrue(pn.size() > 0);
for (AbstractPlanNode nd : pn) {
System.out.println("PlanNode Explain string:\n" + nd.toExplainPlanString());
}
AbstractPlanNode p = pn.get(0).getChild(0);
if (isReplaceable)
assertTrue(p instanceof IndexCountPlanNode);
else
assertTrue((p instanceof IndexCountPlanNode) == false);
}
use of org.voltdb.plannodes.AbstractPlanNode 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);
}
Aggregations