本文整理汇总了C++中CExpressionHandle::FScalarChild方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpressionHandle::FScalarChild方法的具体用法?C++ CExpressionHandle::FScalarChild怎么用?C++ CExpressionHandle::FScalarChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpressionHandle
的用法示例。
在下文中一共展示了CExpressionHandle::FScalarChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @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;
}
示例2:
//---------------------------------------------------------------------------
// @function:
// CLogical::MaxcardDef
//
// @doc:
// Default max card for join and apply operators
//
//---------------------------------------------------------------------------
CMaxCard
CLogical::MaxcardDef
(
CExpressionHandle &exprhdl
)
{
const ULONG ulArity = exprhdl.UlArity();
CMaxCard maxcard = exprhdl.Pdprel(0)->Maxcard();
for (ULONG ul = 1; ul < ulArity - 1; ul++)
{
if (!exprhdl.FScalarChild(ul))
{
maxcard *= exprhdl.Pdprel(ul)->Maxcard();
}
}
return maxcard;
}
示例3: CPartInfo
//---------------------------------------------------------------------------
// @function:
// CDrvdPropScalar::Derive
//
// @doc:
// Derive scalar props
//
//---------------------------------------------------------------------------
void
CDrvdPropScalar::Derive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl,
CDrvdPropCtxt * // pdpctxt
)
{
CScalar *popScalar = CScalar::PopConvert(exprhdl.Pop());
// call derivation functions on the operator
GPOS_ASSERT(NULL == m_pcrsDefined);
m_pcrsDefined = popScalar->PcrsDefined(pmp, exprhdl);
GPOS_ASSERT(NULL == m_pcrsSetReturningFunction);
m_pcrsSetReturningFunction = popScalar->PcrsSetReturningFunction(pmp, exprhdl);
GPOS_ASSERT(NULL == m_pcrsUsed);
m_pcrsUsed = popScalar->PcrsUsed(pmp, exprhdl);
// derive function properties
m_pfp = popScalar->PfpDerive(pmp, exprhdl);
// add defined and used columns of children
const ULONG ulArity = exprhdl.UlArity();
for (ULONG i = 0; i < ulArity; i++)
{
// only propagate properties from scalar children
if (exprhdl.FScalarChild(i))
{
m_pcrsDefined->Union(exprhdl.Pdpscalar(i)->PcrsDefined());
m_pcrsUsed->Union(exprhdl.Pdpscalar(i)->PcrsUsed());
m_pcrsSetReturningFunction->Union(exprhdl.Pdpscalar(i)->PcrsSetReturningFunction());
}
else
{
GPOS_ASSERT(CUtils::FSubquery(popScalar));
// parent operator is a subquery, add outer references
// from its relational child as used columns
m_pcrsUsed->Union(exprhdl.Pdprel(0)->PcrsOuter());
}
}
// derive existence of subqueries
GPOS_ASSERT(!m_fHasSubquery);
m_fHasSubquery = popScalar->FHasSubquery(exprhdl);
if (m_fHasSubquery)
{
m_ppartinfo = popScalar->PpartinfoDerive(pmp, exprhdl);
}
else
{
m_ppartinfo = GPOS_NEW(pmp) CPartInfo(pmp);
}
m_fHasNonScalarFunction = popScalar->FHasNonScalarFunction(exprhdl);
if (COperator::EopScalarProjectList == exprhdl.Pop()->Eopid())
{
m_ulDistinctAggs = CScalarProjectList::UlDistinctAggs(exprhdl);
m_fHasMultipleDistinctAggs = CScalarProjectList::FHasMultipleDistinctAggs(exprhdl);
}
if (COperator::EopScalarProjectElement == exprhdl.Pop()->Eopid())
{
if (m_fHasNonScalarFunction)
{
CScalarProjectElement *pspeProject = (CScalarProjectElement *)(exprhdl.Pop());
m_pcrsSetReturningFunction->Include(pspeProject->Pcr());
}
}
}