当前位置: 首页>>代码示例>>C++>>正文


C++ SeqScanPlanNode::debugInfo方法代码示例

本文整理汇总了C++中SeqScanPlanNode::debugInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ SeqScanPlanNode::debugInfo方法的具体用法?C++ SeqScanPlanNode::debugInfo怎么用?C++ SeqScanPlanNode::debugInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SeqScanPlanNode的用法示例。


在下文中一共展示了SeqScanPlanNode::debugInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UniqueEngineBuilder

TEST_F(CommonTableExpressionTest, verifyPlan) {
    UniqueEngine engine = UniqueEngineBuilder().build();
    bool success = engine->loadCatalog(0, catalogPayload);
    ASSERT_TRUE(success);

    auto ev = ExecutorVector::fromJsonPlan(engine.get(), jsonPlan, 0);
    ASSERT_NE(NULL, ev.get());

    // Verify the outer query
    auto execList = ev->getExecutorList(0);
    ASSERT_EQ(2, execList.size());

    SeqScanPlanNode* seqScanNode = dynamic_cast<SeqScanPlanNode*>(execList[0]->getPlanNode());
    ASSERT_NE(NULL, seqScanNode);
    ASSERT_TRUE(seqScanNode->isCteScan());
    ASSERT_EQ(1, seqScanNode->getCteStmtId());
    ASSERT_EQ("EMP_PATH", seqScanNode->getTargetTableName());
    ASSERT_NE(std::string::npos, seqScanNode->debugInfo("").find("TargetTable[EMP_PATH], scanType[CTE_SCAN]"));

    OrderByPlanNode* obNode = dynamic_cast<OrderByPlanNode*>(execList[1]->getPlanNode());
    ASSERT_NE(NULL, obNode);

    // verify the common table executor node and the base case
    execList = ev->getExecutorList(1);
    ASSERT_EQ(2, execList.size());

    seqScanNode = dynamic_cast<SeqScanPlanNode*>(execList[0]->getPlanNode());
    ASSERT_NE(NULL, seqScanNode);
    ASSERT_TRUE(seqScanNode->isPersistentTableScan());
    ASSERT_EQ(-1, seqScanNode->getCteStmtId());
    ASSERT_EQ("EMPLOYEES", seqScanNode->getTargetTableName());
    ASSERT_NE(std::string::npos,
              seqScanNode->debugInfo("").find("TargetTable[EMPLOYEES], scanType[PERSISTENT_TABLE_SCAN]"));

    CommonTablePlanNode* ctPlanNode = dynamic_cast<CommonTablePlanNode*>(execList[1]->getPlanNode());
    ASSERT_NE(NULL, ctPlanNode);
    ASSERT_EQ(2, ctPlanNode->getRecursiveStmtId());
    ASSERT_EQ("EMP_PATH", ctPlanNode->getCommonTableName());
    ASSERT_NE(std::string::npos,
              ctPlanNode->debugInfo("").find("CommonTable[EMP_PATH], with recursive stmt id[2]"));

    // verify the recursive query
    execList = ev->getExecutorList(2);
    ASSERT_EQ(4, execList.size());

    // LHS of join is a normal scan of EMPLOYEES
    seqScanNode = dynamic_cast<SeqScanPlanNode*>(execList[0]->getPlanNode());
    ASSERT_NE(NULL, seqScanNode);
    ASSERT_TRUE(seqScanNode->isPersistentTableScan());
    ASSERT_EQ(-1, seqScanNode->getCteStmtId());
    ASSERT_EQ("EMPLOYEES", seqScanNode->getTargetTableName());

    // RHS of join is the intermediate result of the recursive CTE
    seqScanNode = dynamic_cast<SeqScanPlanNode*>(execList[1]->getPlanNode());
    ASSERT_NE(NULL, seqScanNode);
    ASSERT_TRUE(seqScanNode->isCteScan());
    ASSERT_EQ(1, seqScanNode->getCteStmtId());
    ASSERT_EQ("EMP_PATH", seqScanNode->getTargetTableName());
    ASSERT_NE(std::string::npos, seqScanNode->debugInfo("").find("TargetTable[EMP_PATH], scanType[CTE_SCAN]"));

    AbstractJoinPlanNode* joinNode = dynamic_cast<AbstractJoinPlanNode*>(execList[2]->getPlanNode());
    ASSERT_NE(NULL, joinNode);

    ProjectionPlanNode* projNode = dynamic_cast<ProjectionPlanNode*>(execList[3]->getPlanNode());
    ASSERT_NE(NULL, projNode);
}
开发者ID:simonzhangsm,项目名称:voltdb,代码行数:66,代码来源:CommonTableExpressionTest.cpp


注:本文中的SeqScanPlanNode::debugInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。