Search in sources :

Example 6 with UnionPlanNode

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

the class TestUnion method testUnionWithExpressionSubquery.

public void testUnionWithExpressionSubquery() {
    AbstractPlanNode pn = compile("select B from T2 union select A from T1 where A in (select B from T2 where T1.A > B)");
    assertTrue(pn.getChild(0) instanceof UnionPlanNode);
    UnionPlanNode unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.UNION);
    assertTrue(unionPN.getChildCount() == 2);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) UnionPlanNode(org.voltdb.plannodes.UnionPlanNode)

Example 7 with UnionPlanNode

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

the class TestUnion method testUnionAll.

public void testUnionAll() {
    AbstractPlanNode pn = compile("select A from T1 UNION ALL select B from T2");
    assertTrue(pn.getChild(0) instanceof UnionPlanNode);
    UnionPlanNode unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.UNION_ALL);
    assertTrue(unionPN.getChildCount() == 2);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) UnionPlanNode(org.voltdb.plannodes.UnionPlanNode)

Example 8 with UnionPlanNode

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

the class TestUnion method testExcept.

public void testExcept() {
    AbstractPlanNode pn = compile("select A from T1 EXCEPT select B from T2 EXCEPT select C from T3 EXCEPT select F from T6");
    assertTrue(pn.getChild(0) instanceof UnionPlanNode);
    UnionPlanNode unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.EXCEPT);
    assertTrue(unionPN.getChildCount() == 4);
    pn = compile("select A from T1 EXCEPT (select B from T2 EXCEPT select C from T3) EXCEPT select F from T6");
    unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.EXCEPT);
    assertTrue(unionPN.getChildCount() == 3);
    UnionPlanNode childPN = (UnionPlanNode) unionPN.getChild(1);
    assertTrue(childPN.getUnionType() == ParsedUnionStmt.UnionType.EXCEPT);
    assertTrue(childPN.getChildCount() == 2);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) UnionPlanNode(org.voltdb.plannodes.UnionPlanNode)

Example 9 with UnionPlanNode

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

the class TestUnion method testPartitioningMixes.

public void testPartitioningMixes() {
    // Sides are identically single-partitioned.
    AbstractPlanNode pn = compile("select DESC from T1 WHERE A = 1 UNION select TEXT from T5 WHERE E = 1");
    assertTrue(pn.getChild(0) instanceof UnionPlanNode);
    UnionPlanNode unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.UNION);
    assertTrue(unionPN.getChildCount() == 2);
// In the future, new capabilities like "pushdown of set ops into the collector fragment" and
// "designation of coordinator execution sites for multi-partition (multi-fragment) plans"
// may allow more liberal mixes of selects on partitioned tables.
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) UnionPlanNode(org.voltdb.plannodes.UnionPlanNode)

Example 10 with UnionPlanNode

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

the class TestUnion method testIntersectAll.

public void testIntersectAll() {
    AbstractPlanNode pn = compile("select A from T1 INTERSECT ALL select B from T2");
    assertTrue(pn.getChild(0) instanceof UnionPlanNode);
    UnionPlanNode unionPN = (UnionPlanNode) pn.getChild(0);
    assertTrue(unionPN.getUnionType() == ParsedUnionStmt.UnionType.INTERSECT_ALL);
    assertTrue(unionPN.getChildCount() == 2);
}
Also used : AbstractPlanNode(org.voltdb.plannodes.AbstractPlanNode) UnionPlanNode(org.voltdb.plannodes.UnionPlanNode)

Aggregations

AbstractPlanNode (org.voltdb.plannodes.AbstractPlanNode)14 UnionPlanNode (org.voltdb.plannodes.UnionPlanNode)14 ProjectionPlanNode (org.voltdb.plannodes.ProjectionPlanNode)3 SeqScanPlanNode (org.voltdb.plannodes.SeqScanPlanNode)3 OrderByPlanNode (org.voltdb.plannodes.OrderByPlanNode)2 ArrayList (java.util.ArrayList)1 Constraint (org.voltdb.catalog.Constraint)1 AbstractExpression (org.voltdb.expressions.AbstractExpression)1 LimitPlanNode (org.voltdb.plannodes.LimitPlanNode)1 NestLoopPlanNode (org.voltdb.plannodes.NestLoopPlanNode)1