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);
}
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);
}
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);
}
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.
}
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);
}
Aggregations