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