當前位置: 首頁>>代碼示例>>Java>>正文


Java NestLoopIndexPlanNode類代碼示例

本文整理匯總了Java中org.voltdb.plannodes.NestLoopIndexPlanNode的典型用法代碼示例。如果您正苦於以下問題:Java NestLoopIndexPlanNode類的具體用法?Java NestLoopIndexPlanNode怎麽用?Java NestLoopIndexPlanNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NestLoopIndexPlanNode類屬於org.voltdb.plannodes包,在下文中一共展示了NestLoopIndexPlanNode類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: injectIndexedJoinWithMaterializedScan

import org.voltdb.plannodes.NestLoopIndexPlanNode; //導入依賴的package包/類
private static AbstractPlanNode injectIndexedJoinWithMaterializedScan(AbstractExpression listElements,
                                                               IndexScanPlanNode scanNode)
{
    MaterializedScanPlanNode matScan = new MaterializedScanPlanNode();
    assert(listElements instanceof VectorValueExpression || listElements instanceof ParameterValueExpression);
    matScan.setRowData(listElements);
    matScan.setSortDirection(scanNode.getSortDirection());

    NestLoopIndexPlanNode nlijNode = new NestLoopIndexPlanNode();
    nlijNode.setJoinType(JoinType.INNER);
    nlijNode.addInlinePlanNode(scanNode);
    nlijNode.addAndLinkChild(matScan);
    // resolve the sort direction
    nlijNode.resolveSortDirection();
    return nlijNode;
}
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:17,代碼來源:SubPlanAssembler.java

示例2: testEng3850ComplexIndexablePlan

import org.voltdb.plannodes.NestLoopIndexPlanNode; //導入依賴的package包/類
public void testEng3850ComplexIndexablePlan()
    {
        AbstractPlanNode pn = compile("select id from a, t where a.id < (t.a + ?);");
        pn = pn.getChild(0);
        pn = pn.getChild(0);
//        System.out.println("DEBUG: " + pn.toExplainPlanString());
        assertTrue(pn instanceof NestLoopIndexPlanNode);
        IndexScanPlanNode indexScan = (IndexScanPlanNode)pn.getInlinePlanNode(PlanNodeType.INDEXSCAN);
        assertEquals(IndexLookupType.LT, indexScan.getLookupType());
        assertTrue(indexScan.toJSONString().contains("\"TARGET_INDEX_NAME\":\"" +
                HSQLInterface.AUTO_GEN_CONSTRAINT_WRAPPER_PREFIX + "ID"));
        pn = pn.getChild(0);
        assertTrue(pn instanceof SeqScanPlanNode);
//        System.out.println("DEBUG: " + pn.toJSONString());
        assertTrue(pn.toJSONString().contains("\"TARGET_TABLE_NAME\":\"T\""));
    }
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:17,代碼來源:TestIndexSelection.java

示例3: testBasicThreeTableInnerJoin

import org.voltdb.plannodes.NestLoopIndexPlanNode; //導入依賴的package包/類
public void testBasicThreeTableInnerJoin() {
    AbstractPlanNode pn = compile("select * FROM R1 JOIN R2 ON R1.C = R2.C JOIN R3 ON R3.C = R2.C");
    AbstractPlanNode n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof NestLoopPlanNode);
    assertTrue(n.getChild(0) instanceof NestLoopPlanNode);
    assertTrue(n.getChild(1) instanceof SeqScanPlanNode);
    assertEquals(7, pn.getOutputSchema().getColumns().size());

    pn = compile("select R1.C, R2.C R3.C FROM R1 INNER JOIN R2 ON R1.C = R2.C INNER JOIN R3 ON R3.C = R2.C");
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof NestLoopPlanNode);
    assertTrue(n.getChild(0) instanceof NestLoopPlanNode);
    assertTrue(n.getChild(1) instanceof SeqScanPlanNode);

    pn = compile("select C FROM R1 INNER JOIN R2 USING (C) INNER JOIN R3 USING(C)");
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof NestLoopPlanNode);
    assertTrue(n.getChild(0) instanceof NestLoopPlanNode);
    assertTrue(n.getChild(1) instanceof SeqScanPlanNode);
    assertEquals(1, pn.getOutputSchema().getColumns().size());

    pn = compile("select C FROM R1 INNER JOIN R2 USING (C), R3 WHERE R1.A = R3.A");
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof NestLoopPlanNode);
    assertTrue(n.getChild(0) instanceof NestLoopIndexPlanNode);
    assertTrue(n.getChild(1) instanceof SeqScanPlanNode);
    assertEquals(1, pn.getOutputSchema().getColumns().size());

    failToCompile("select C, R3.C FROM R1 INNER JOIN R2 USING (C) INNER JOIN R3 ON R1.C = R3.C",
                  "user lacks privilege or object not found: R1.C");
}
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:32,代碼來源:TestPlansJoin.java

示例4: testMultitableDistributedJoin

import org.voltdb.plannodes.NestLoopIndexPlanNode; //導入依賴的package包/類
public void testMultitableDistributedJoin() {
  // One distributed table
  List<AbstractPlanNode> lpn = compileToFragments("select *  FROM R3,R1 LEFT JOIN P2 ON R3.A = P2.A WHERE R3.A=R1.A ");
  assertTrue(lpn.size() == 2);
  AbstractPlanNode n = lpn.get(0).getChild(0).getChild(0);
  assertTrue(n instanceof NestLoopPlanNode);
  assertTrue(JoinType.LEFT == ((NestLoopPlanNode) n).getJoinType());
  AbstractPlanNode c = n.getChild(0);
  assertTrue(c instanceof NestLoopIndexPlanNode);

  // R3.A and P2.A have an index. P2,R1 is NLIJ/inlined IndexScan because it's an inner join even P2 is distributed
  lpn = compileToFragments("select *  FROM P2,R1 LEFT JOIN R3 ON R3.A = P2.A WHERE P2.A=R1.A ");
  assertTrue(lpn.size() == 2);
  n = lpn.get(0).getChild(0).getChild(0);
  assertTrue(n instanceof ReceivePlanNode);
  n = lpn.get(1).getChild(0);
  assertTrue(n instanceof NestLoopIndexPlanNode);
  assertTrue(JoinType.LEFT == ((NestLoopIndexPlanNode) n).getJoinType());
  c = n.getChild(0);
  assertTrue(c instanceof NestLoopIndexPlanNode);

  // R3.A has an index. R3,P2 is NLJ because it's an outer join and P2 is distributed
  lpn = compileToFragments("select *  FROM R3,R1 LEFT JOIN P2 ON R3.A = P2.A WHERE R3.A=R1.A ");
  assertTrue(lpn.size() == 2);
  // to debug */ System.out.println("DEBUG 0.0: " + lpn.get(0).toExplainPlanString());
  // to debug */ System.out.println("DEBUG 0.1: " + lpn.get(1).toExplainPlanString());
  n = lpn.get(0).getChild(0).getChild(0);
  assertTrue(n instanceof NestLoopPlanNode);
  assertTrue(JoinType.LEFT == ((NestLoopPlanNode) n).getJoinType());
  c = n.getChild(0);
  assertTrue(c instanceof NestLoopIndexPlanNode);
  assertTrue(JoinType.INNER == ((NestLoopIndexPlanNode) c).getJoinType());
  c = n.getChild(1);
  assertTrue(c instanceof ReceivePlanNode);
  n = lpn.get(1).getChild(0);
  // For determinism reason
  assertTrue(n instanceof IndexScanPlanNode);

  // R3.A has an index. P2,R1 is NLJ because P2 is distributed and it's an outer join
  lpn = compileToFragments("select *  FROM R1 LEFT JOIN P2 ON R1.A = P2.A, R3 WHERE R1.A=R3.A ");
  assertTrue(lpn.size() == 2);
  // to debug */ System.out.println("DEBUG 1.0: " + lpn.get(0).toExplainPlanString());
  // to debug */ System.out.println("DEBUG 1.1: " + lpn.get(1).toExplainPlanString());
  n = lpn.get(0).getChild(0).getChild(0);
  assertTrue(n instanceof NestLoopIndexPlanNode);
  assertTrue(JoinType.INNER == ((NestLoopIndexPlanNode) n).getJoinType());
  n = n.getChild(0);
  assertTrue(n instanceof NestLoopPlanNode);
  c = n.getChild(0);
  assertTrue(c instanceof SeqScanPlanNode);
  c = n.getChild(1);
  assertTrue(c instanceof ReceivePlanNode);
  n = lpn.get(1).getChild(0);
  // For determinism reason
  assertTrue(n instanceof IndexScanPlanNode);

  // Two distributed table
  lpn = compileToFragments("select *  FROM R3,P1 LEFT JOIN P2 ON R3.A = P2.A WHERE R3.A=P1.A ");
  assertTrue(lpn.size() == 2);
  n = lpn.get(0).getChild(0).getChild(0);
  assertTrue(n instanceof ReceivePlanNode);
  n = lpn.get(1).getChild(0);
  assertTrue(JoinType.LEFT == ((NestLoopIndexPlanNode) n).getJoinType());
  c = n.getChild(0);
  assertTrue(c instanceof NestLoopIndexPlanNode);
  assertTrue(JoinType.INNER == ((NestLoopIndexPlanNode) c).getJoinType());
}
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:68,代碼來源:TestMultipleOuterJoinPlans.java

示例5: testDistributedIndexJoinConditions

import org.voltdb.plannodes.NestLoopIndexPlanNode; //導入依賴的package包/類
public void testDistributedIndexJoinConditions() {
    // Distributed outer table, replicated inner -NLIJ/inlined IndexScan
    List<AbstractPlanNode> lpn;
    //AbstractPlanNode pn;
    AbstractPlanNode n;
    lpn = compileToFragments("select * FROM P1 LEFT JOIN R3 ON P1.C = R3.A");
    assertEquals(2, lpn.size());
    n = lpn.get(1).getChild(0);
    assertTrue(n instanceof NestLoopIndexPlanNode);
    assertEquals(1, n.getChildCount());
    assertTrue(n.getChild(0) instanceof SeqScanPlanNode);

    // Distributed inner  and replicated outer tables -NLJ/IndexScan
    lpn = compileToFragments("select *  FROM R3 LEFT JOIN P2 ON R3.A = P2.A AND P2.A < 0 AND P2.E > 3 WHERE P2.A IS NULL");
    assertEquals(2, lpn.size());
    for (AbstractPlanNode apn: lpn) {
        System.out.println(apn.toExplainPlanString());
    }

    n = lpn.get(0).getChild(0).getChild(0);
    assertTrue(n instanceof NestLoopPlanNode);
    assertEquals(JoinType.LEFT, ((NestLoopPlanNode) n).getJoinType());
    assertNotNull(((NestLoopPlanNode) n).getJoinPredicate());
    assertNotNull(((NestLoopPlanNode) n).getWherePredicate());
    AbstractPlanNode c = n.getChild(0);
    assertTrue(c instanceof SeqScanPlanNode);
    c = n.getChild(1);
    assertTrue(c instanceof ReceivePlanNode);
    n = lpn.get(1).getChild(0);
    assertTrue(n instanceof IndexScanPlanNode);
    IndexScanPlanNode in = (IndexScanPlanNode) n;
    assertEquals(IndexLookupType.LT, in.getLookupType());

    assertNotNull(in.getPredicate());
    assertEquals(ExpressionType.CONJUNCTION_AND, in.getPredicate().getExpressionType());
    assertEquals(ExpressionType.COMPARE_GREATERTHAN, in.getPredicate().getLeft().getExpressionType());
    assertEquals(ExpressionType.OPERATOR_NOT, in.getPredicate().getRight().getExpressionType());

    // Distributed inner  and outer tables -NLIJ/inlined IndexScan
    lpn = compileToFragments("select *  FROM P2 RIGHT JOIN P3 ON P3.A = P2.A AND P2.A < 0 WHERE P2.A IS NULL");
    assertEquals(2, lpn.size());
    n = lpn.get(1).getChild(0);
    assertTrue(n instanceof NestLoopIndexPlanNode);
    assertEquals(JoinType.LEFT, ((NestLoopIndexPlanNode) n).getJoinType());
    assertNull(((NestLoopIndexPlanNode) n).getJoinPredicate());
    assertNotNull(((NestLoopIndexPlanNode) n).getWherePredicate());
    AbstractExpression w = ((NestLoopIndexPlanNode) n).getWherePredicate();
    assertEquals(ExpressionType.OPERATOR_IS_NULL, w.getExpressionType());
    IndexScanPlanNode indexScan = (IndexScanPlanNode)n.getInlinePlanNode(PlanNodeType.INDEXSCAN);
    assertEquals(IndexLookupType.EQ, indexScan.getLookupType());
    assertEquals(ExpressionType.COMPARE_EQUAL, indexScan.getEndExpression().getExpressionType());
    w = indexScan.getPredicate();
    assertNotNull(w);
    assertEquals(ExpressionType.COMPARE_LESSTHAN, w.getExpressionType());
}
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:56,代碼來源:TestPlansJoin.java


注:本文中的org.voltdb.plannodes.NestLoopIndexPlanNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。