本文整理匯總了Java中org.voltdb.plannodes.UnionPlanNode類的典型用法代碼示例。如果您正苦於以下問題:Java UnionPlanNode類的具體用法?Java UnionPlanNode怎麽用?Java UnionPlanNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
UnionPlanNode類屬於org.voltdb.plannodes包,在下文中一共展示了UnionPlanNode類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testPartitioningMixes
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
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.
}
示例2: testUnionAll
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
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);
}
示例3: testIntersectAll
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
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);
}
示例4: testMultipleSetOperations
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
public void testMultipleSetOperations() {
AbstractPlanNode pn = compile("select A from T1 UNION select B from T2 EXCEPT select C from T3");
assertTrue(pn.getChild(0) instanceof UnionPlanNode);
UnionPlanNode unionPN1 = (UnionPlanNode) pn.getChild(0);
assertTrue(unionPN1.getUnionType() == ParsedUnionStmt.UnionType.EXCEPT);
assertTrue(unionPN1.getChildCount() == 2);
assertTrue(unionPN1.getChild(0) instanceof UnionPlanNode);
UnionPlanNode unionPN2 = (UnionPlanNode) unionPN1.getChild(0);
assertTrue(unionPN2.getUnionType() == ParsedUnionStmt.UnionType.UNION);
assertTrue(unionPN2.getChildCount() == 2);
assertTrue(unionPN1.getChild(1) instanceof SeqScanPlanNode);
}
示例5: testSelfUnion
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
public void testSelfUnion() {
AbstractPlanNode pn = compile("select B from T2 UNION select B from T2");
assertTrue(pn.getChild(0) instanceof UnionPlanNode);
pn = pn.getChild(0);
assertTrue(pn.getChildCount() == 2);
assertTrue(pn.getChild(0) instanceof SeqScanPlanNode);
assertTrue(pn.getChild(1) instanceof SeqScanPlanNode);
// The same table/alias is repeated twice in the union but in the different selects
pn = compile("select B from T2 A1, T2 A2 WHERE A1.B = A2.B UNION select B from T2 A1");
assertTrue(pn.getChild(0) instanceof UnionPlanNode);
pn = pn.getChild(0);
assertTrue(pn.getChildCount() == 2);
assertTrue(pn.getChild(0) instanceof ProjectionPlanNode);
assertTrue(pn.getChild(0).getChild(0) instanceof NestLoopPlanNode);
assertTrue(pn.getChild(1) instanceof SeqScanPlanNode);
// BOTH sides are single-partitioned for the same partition
pn = compile("select F from T1 WHERE T1.A = 2 UNION select F from T1 WHERE T1.A = 2");
assertTrue(pn.getChild(0) instanceof UnionPlanNode);
// If BOTH sides are single-partitioned, but for different partitions,
// it would theoretically be possible to satisfy
// the query with a 2-fragment plan IFF the coordinator fragment could be forced to
// execute on one of the designated single partitions.
// At this point, coordinator designation is only supported for single-fragment plans.
failToCompile("select DESC from T1 WHERE A = 1 UNION select DESC from T1 WHERE A = 2");
// If both sides are multi-partitioned, there is no facility for pushing down the
// union processing below the send/receive, so each child of the union requires
// its own send/receive so the plan ends up as an unsupported 3-fragment plan.
failToCompile("select DESC from T1 UNION select DESC from T1");
}
示例6: testUnions
import org.voltdb.plannodes.UnionPlanNode; //導入依賴的package包/類
public void testUnions() {
AbstractPlanNode pn;
pn = compile("select A, C FROM (SELECT A, C FROM R1 UNION SELECT A, C FROM R2 UNION SELECT A, C FROM R3) T1 order by A ");
pn = pn.getChild(0);
assertTrue(pn instanceof ProjectionPlanNode);
pn = pn.getChild(0);
assertTrue(pn instanceof OrderByPlanNode);
pn = pn.getChild(0);
checkSeqScan(pn, "T1", "A", "C");
AbstractPlanNode upn = pn.getChild(0);
assertTrue(upn instanceof UnionPlanNode);
pn = upn.getChild(0);
checkSeqScan(pn, "R1", "A", "C");
pn = upn.getChild(1);
checkSeqScan(pn, "R2", "A", "C");
pn = upn.getChild(2);
checkSeqScan(pn, "R3", "A", "C");
String message = "This join of multiple partitioned tables is too complex";
failToCompile("select * FROM " +
"(SELECT A, COUNT(*) FROM P1 GROUP BY A " +
"UNION " +
"SELECT A, COUNT(*) FROM R2 GROUP BY A) T1 , P2 where T1.A = P2.A ", message);
}