本文整理汇总了C++中CExpressionHandle::Pdpplan方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpressionHandle::Pdpplan方法的具体用法?C++ CExpressionHandle::Pdpplan怎么用?C++ CExpressionHandle::Pdpplan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpressionHandle
的用法示例。
在下文中一共展示了CExpressionHandle::Pdpplan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CPhysicalPartitionSelector::EpetDistribution
//
// @doc:
// Return the enforcing type for distribution property based on this operator
//
//---------------------------------------------------------------------------
CEnfdProp::EPropEnforcingType
CPhysicalPartitionSelector::EpetDistribution
(
CExpressionHandle &exprhdl,
const CEnfdDistribution *ped
)
const
{
CDrvdPropPlan *pdpplan = exprhdl.Pdpplan(0 /* child_index */);
if (ped->FCompatible(pdpplan->Pds()))
{
// required distribution established by the operator
return CEnfdProp::EpetUnnecessary;
}
CPartIndexMap *ppimDrvd = pdpplan->Ppim();
if (!ppimDrvd->Contains(m_scan_id))
{
// part consumer is defined above: prohibit adding a motion on top of the
// part resolver as this will create two slices
return CEnfdProp::EpetProhibited;
}
GPOS_ASSERT(CPartIndexMap::EpimConsumer == ppimDrvd->Epim(m_scan_id));
// part consumer found below: enforce distribution on top of part resolver
return CEnfdProp::EpetRequired;
}
示例2: at
//---------------------------------------------------------------------------
// @function:
// CPhysicalUnionAll::AssertValidChildDistributions
//
// @doc:
// Helper to validate child distributions
//
//---------------------------------------------------------------------------
void
CPhysicalUnionAll::AssertValidChildDistributions
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
CDistributionSpec::EDistributionType *pedt, // array of distribution types to check
ULONG ulDistrs, // number of distribution types to check
const CHAR *szAssertMsg
)
{
const ULONG ulArity = exprhdl.UlArity();
for (ULONG ulChild = 0; ulChild < ulArity; ulChild++)
{
CDistributionSpec *pdsChild = exprhdl.Pdpplan(ulChild)->Pds();
CDistributionSpec::EDistributionType edtChild = pdsChild->Edt();
BOOL fMatch = false;
for (ULONG ulDistr = 0; !fMatch && ulDistr < ulDistrs; ulDistr++)
{
fMatch = (pedt[ulDistr] == edtChild);
}
if (!fMatch)
{
CAutoTrace at(pmp);
at.Os() << szAssertMsg;
}
GPOS_ASSERT(fMatch);
}
}
示例3:
//---------------------------------------------------------------------------
// @function:
// CPhysical::FChildrenHaveCompatibleDistributions
//
// @doc:
// Returns true iff the delivered distributions of the children are
// compatible among themselves.
//
//---------------------------------------------------------------------------
BOOL
CPhysical::FCompatibleChildrenDistributions
(
const CExpressionHandle &exprhdl
)
const
{
GPOS_ASSERT(exprhdl.Pop() == this);
BOOL fSingletonOrUniversalChild = false;
BOOL fNotSingletonOrUniversalDistributedChild = false;
const ULONG arity = exprhdl.Arity();
for (ULONG ul = 0; ul < arity; ul++)
{
if (!exprhdl.FScalarChild(ul))
{
CDrvdPropPlan *pdpplanChild = exprhdl.Pdpplan(ul);
// an operator cannot have a singleton or universal distributed child
// and one distributed on multiple nodes
// this assumption is safe for all current operators, but it can be
// too conservative: we could allow for instance the following cases
// * LeftOuterJoin (universal, distributed)
// * AntiSemiJoin (universal, distributed)
// These cases can be enabled if considered necessary by overriding
// this function.
if (CDistributionSpec::EdtUniversal == pdpplanChild->Pds()->Edt() ||
pdpplanChild->Pds()->FSingletonOrStrictSingleton())
{
fSingletonOrUniversalChild = true;
}
else
{
fNotSingletonOrUniversalDistributedChild = true;
}
if (fSingletonOrUniversalChild && fNotSingletonOrUniversalDistributedChild)
{
return false;
}
}
}
return true;
}