本文整理汇总了C++中CDistributionSpec::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ CDistributionSpec::AddRef方法的具体用法?C++ CDistributionSpec::AddRef怎么用?C++ CDistributionSpec::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDistributionSpec
的用法示例。
在下文中一共展示了CDistributionSpec::AddRef方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CPhysicalUnionAll::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalUnionAll::PdsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl
)
const
{
CDistributionSpecHashed *pdshashed = PdshashedDerive(pmp, exprhdl);
if (NULL != pdshashed)
{
return pdshashed;
}
CDistributionSpec *pds = PdsDeriveFromChildren(pmp, exprhdl);
if (NULL != pds)
{
// succeeded in deriving output distribution from child distributions
pds->AddRef();
return pds;
}
// output has unknown distribution on all segments
return GPOS_NEW(pmp) CDistributionSpecRandom();
}
示例2: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CLogicalSequenceProject::PopRemoveLocalOuterRefs
//
// @doc:
// Filter out outer references from Order By/ Partition By
// clauses, and return a new operator
//
//---------------------------------------------------------------------------
CLogicalSequenceProject *
CLogicalSequenceProject::PopRemoveLocalOuterRefs
(
IMemoryPool *mp,
CExpressionHandle &exprhdl
)
{
GPOS_ASSERT(this == exprhdl.Pop());
CColRefSet *outer_refs = exprhdl.GetRelationalProperties()->PcrsOuter();
CDistributionSpec *pds = m_pds;
if (CDistributionSpec::EdtHashed == m_pds->Edt())
{
pds = CDistributionSpecHashed::PdsConvert(m_pds)->PdshashedExcludeColumns(mp, outer_refs);
if (NULL == pds)
{
// if the hashed distribution spec is empty after excluding the outer ref columns,
// eliminate Partition clause by creating a singleton spec
pds = GPOS_NEW(mp) CDistributionSpecSingleton();
}
}
else
{
pds->AddRef();
}
COrderSpecArray *pdrgpos = COrderSpec::PdrgposExclude(mp, m_pdrgpos, outer_refs);
// for window frame edges, outer references cannot be removed since this can change
// the semantics of frame edge from delayed-bounding to unbounded,
// we re-use the frame edges without changing here
m_pdrgpwf->AddRef();
return GPOS_NEW(mp) CLogicalSequenceProject(mp, pds, pdrgpos, m_pdrgpwf);
}
示例3: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CPhysicalUnionAll::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalUnionAll::PdsDerive
(
IMemoryPool *mp,
CExpressionHandle &exprhdl
)
const
{
CDistributionSpecHashed *pdshashed = PdshashedDerive(mp, exprhdl);
if (NULL != pdshashed)
{
return pdshashed;
}
CDistributionSpec *pds = PdsDeriveFromChildren(mp, exprhdl);
if (NULL != pds)
{
// succeeded in deriving output distribution from child distributions
pds->AddRef();
return pds;
}
// derive strict random spec, if parallel union all enforces strict random
CDistributionSpecRandom *random_dist_spec = PdsStrictRandomParallelUnionAllChildren(mp, exprhdl);
if (NULL != random_dist_spec)
{
return random_dist_spec;
}
// output has unknown distribution on all segments
return GPOS_NEW(mp) CDistributionSpecRandom();
}
示例4: PdsDeriveFromReplicatedOuter
//---------------------------------------------------------------------------
// @function:
// CPhysicalInnerHashJoin::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalInnerHashJoin::PdsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl
)
const
{
CDistributionSpec *pdsOuter = exprhdl.Pdpplan(0 /*ulChildIndex*/)->Pds();
CDistributionSpec *pdsInner = exprhdl.Pdpplan(1 /*ulChildIndex*/)->Pds();
if (CDistributionSpec::EdtUniversal == pdsOuter->Edt())
{
// if outer is universal, pass through inner distribution
pdsInner->AddRef();
return pdsInner;
}
if (CDistributionSpec::EdtHashed == pdsOuter->Edt() && CDistributionSpec::EdtHashed == pdsInner->Edt())
{
CDistributionSpec *pdsDerived = PdsDeriveFromHashedChildren(pmp, pdsOuter, pdsInner);
if (NULL != pdsDerived)
{
return pdsDerived;
}
}
if (CDistributionSpec::EdtReplicated == pdsOuter->Edt())
{
return PdsDeriveFromReplicatedOuter(pmp, pdsOuter, pdsInner);
}
if (CDistributionSpec::EdtHashed == pdsOuter->Edt())
{
CDistributionSpec *pdsDerived = PdsDeriveFromHashedOuter(pmp, pdsOuter, pdsInner);
if (NULL != pdsDerived)
{
return pdsDerived;
}
}
// otherwise, pass through outer distribution
pdsOuter->AddRef();
return pdsOuter;
}
示例5:
//---------------------------------------------------------------------------
// @function:
// CPhysical::PdsDerivePassThruOuter
//
// @doc:
// Helper for common case of distribution derivation
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysical::PdsDerivePassThruOuter
(
CExpressionHandle &exprhdl
)
{
CDistributionSpec *pds = exprhdl.Pdpplan(0 /*child_index*/)->Pds();
pds->AddRef();
return pds;
}
示例6: Pds
//---------------------------------------------------------------------------
// @function:
// CPhysicalMotion::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalMotion::PdsDerive
(
IMemoryPool */*pmp*/,
CExpressionHandle &/*exprhdl*/
)
const
{
CDistributionSpec *pds = Pds();
pds->AddRef();
return pds;
}
示例7:
//---------------------------------------------------------------------------
// @function:
// CPhysicalJoin::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalJoin::PdsDerive
(
IMemoryPool *, // pmp,
CExpressionHandle &exprhdl
)
const
{
CDistributionSpec *pdsOuter = exprhdl.Pdpplan(0 /*ulChildIndex*/)->Pds();
CDistributionSpec *pdsInner = exprhdl.Pdpplan(1 /*ulChildIndex*/)->Pds();
if (CDistributionSpec::EdtReplicated == pdsOuter->Edt() ||
CDistributionSpec::EdtUniversal == pdsOuter->Edt())
{
// if outer is replicated/universal, return inner distribution
pdsInner->AddRef();
return pdsInner;
}
// otherwise, return outer distribution
pdsOuter->AddRef();
return pdsOuter;
}
示例8: PdsConvert
//---------------------------------------------------------------------------
// @function:
// CPhysicalHashJoin::PdshashedRequired
//
// @doc:
// Compute required hashed distribution of the n-th child
//
//---------------------------------------------------------------------------
CDistributionSpecHashed *
CPhysicalHashJoin::PdshashedRequired
(
IMemoryPool *, // pmp
ULONG, // ulChildIndex
ULONG ulReqIndex
)
const
{
GPOS_ASSERT(ulReqIndex < m_pdrgpdsRedistributeRequests->UlLength());
CDistributionSpec *pds = (*m_pdrgpdsRedistributeRequests)[ulReqIndex];
pds->AddRef();
return CDistributionSpecHashed::PdsConvert(pds);
}
示例9:
//---------------------------------------------------------------------------
// @function:
// CPhysicalSequence::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalSequence::PdsDerive
(
IMemoryPool *, // pmp,
CExpressionHandle &exprhdl
)
const
{
// pass through distribution from last child
const ULONG ulArity = exprhdl.UlArity();
GPOS_ASSERT(1 <= ulArity);
CDistributionSpec *pds = exprhdl.Pdpplan(ulArity - 1 /*ulChildIndex*/)->Pds();
pds->AddRef();
return pds;
}
示例10: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CPhysicalComputeScalar::PdsDerive
//
// @doc:
// Derive distribution
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalComputeScalar::PdsDerive
(
IMemoryPool *pmp,
CExpressionHandle &exprhdl
)
const
{
CDistributionSpec *pds = exprhdl.Pdpplan(0 /*ulChildIndex*/)->Pds();
if (CDistributionSpec::EdtUniversal == pds->Edt() &&
IMDFunction::EfsVolatile == exprhdl.Pdpscalar(1 /*ulChildIndex*/)->Pfp()->Efs())
{
return GPOS_NEW(pmp) CDistributionSpecStrictSingleton(CDistributionSpecSingleton::EstMaster);
}
pds->AddRef();
return pds;
}