本文整理汇总了C++中CExpression::PrppCompute方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpression::PrppCompute方法的具体用法?C++ CExpression::PrppCompute怎么用?C++ CExpression::PrppCompute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpression
的用法示例。
在下文中一共展示了CExpression::PrppCompute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eng
//---------------------------------------------------------------------------
// @function:
// COptimizer::PexprOptimize
//
// @doc:
// Optimize query in given query context
//
//---------------------------------------------------------------------------
CExpression *
COptimizer::PexprOptimize
(
IMemoryPool *pmp,
CQueryContext *pqc,
DrgPss *pdrgpss
)
{
CEngine eng(pmp);
eng.Init(pqc, pdrgpss);
eng.Optimize();
GPOS_CHECK_ABORT;
CExpression *pexprPlan = eng.PexprExtractPlan();
(void) pexprPlan->PrppCompute(pmp, pqc->Prpp());
GPOS_CHECK_ABORT;
return pexprPlan;
}
示例2: amp
//.........这里部分代码省略.........
CAutoOptCtxt aoc
(
mp,
&mda,
NULL, /* pceeval */
CTestUtils::GetCostModel(mp)
);
// translate DXL Tree -> Expr Tree
CTranslatorDXLToExpr *pdxltr = GPOS_NEW(mp) CTranslatorDXLToExpr(mp, &mda);
CExpression *pexprTranslated = pdxltr->PexprTranslateQuery
(
ptroutput->CreateDXLNode(),
ptroutput->GetOutputColumnsDXLArray(),
ptroutput->GetCTEProducerDXLArray()
);
gpdxl::ULongPtrArray *pdrgul = pdxltr->PdrgpulOutputColRefs();
gpmd::CMDNameArray *pdrgpmdname = pdxltr->Pdrgpmdname();
ULONG ulSegments = GPOPT_TEST_SEGMENTS;
CQueryContext *pqc = CQueryContext::PqcGenerate(mp, pexprTranslated, pdrgul, pdrgpmdname, true /*fDeriveStats*/);
// optimize logical expression tree into physical expression tree.
CEngine eng(mp);
CSerializableOptimizerConfig serOptConfig(mp, optimizer_config);
eng.Init(pqc, NULL /*search_stage_array*/);
eng.Optimize();
CExpression *pexprPlan = eng.PexprExtractPlan();
(void) pexprPlan->PrppCompute(mp, pqc->Prpp());
// translate plan into DXL
IntPtrArray *pdrgpiSegments = GPOS_NEW(mp) IntPtrArray(mp);
GPOS_ASSERT(0 < ulSegments);
for (ULONG ul = 0; ul < ulSegments; ul++)
{
pdrgpiSegments->Append(GPOS_NEW(mp) INT(ul));
}
CTranslatorExprToDXL ptrexprtodxl(mp, &mda, pdrgpiSegments);
CDXLNode *pdxlnPlan = ptrexprtodxl.PdxlnTranslate(pexprPlan, pqc->PdrgPcr(), pqc->Pdrgpmdname());
GPOS_ASSERT(NULL != pdxlnPlan);
CSerializablePlan serPlan(mp, pdxlnPlan, optimizer_config->GetEnumeratorCfg()->GetPlanId(), optimizer_config->GetEnumeratorCfg()->GetPlanSpaceSize());
GPOS_CHECK_ABORT;
// simulate an exception
GPOS_OOM_CHECK(NULL);
}
GPOS_CATCH_EX(ex)
{
// unless we're simulating faults, the exception must be OOM
GPOS_ASSERT_IMP
(
!GPOS_FTRACE(EtraceSimulateAbort) && !GPOS_FTRACE(EtraceSimulateIOError) && !IWorker::m_enforce_time_slices,
CException::ExmaSystem == ex.Major() && CException::ExmiOOM == ex.Minor()
);
mdrs.Finalize();