本文整理汇总了C++中CExpressionHandle::GetRelationalProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpressionHandle::GetRelationalProperties方法的具体用法?C++ CExpressionHandle::GetRelationalProperties怎么用?C++ CExpressionHandle::GetRelationalProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpressionHandle
的用法示例。
在下文中一共展示了CExpressionHandle::GetRelationalProperties方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CLogicalUnion::Maxcard
//
// @doc:
// Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalUnion::Maxcard
(
IMemoryPool *, // mp
CExpressionHandle &exprhdl
)
const
{
const ULONG arity = exprhdl.Arity();
CMaxCard maxcard = exprhdl.GetRelationalProperties(0)->Maxcard();
for (ULONG ul = 1; ul < arity; ul++)
{
maxcard += exprhdl.GetRelationalProperties(ul)->Maxcard();
}
return maxcard;
}
示例2: Maxcard
//---------------------------------------------------------------------------
// @function:
// CLogicalLeftSemiApply::Maxcard
//
// @doc:
// Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalLeftSemiApply::Maxcard
(
IMemoryPool *, // mp
CExpressionHandle &exprhdl
)
const
{
return CLogical::Maxcard(exprhdl, 2 /*ulScalarIndex*/, exprhdl.GetRelationalProperties(0)->Maxcard());
}
示例3:
//---------------------------------------------------------------------------
// @function:
// CLogicalSequence::Maxcard
//
// @doc:
// Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSequence::Maxcard
(
IMemoryPool *, // mp
CExpressionHandle &exprhdl
)
const
{
// pass on max card of last child
return exprhdl.GetRelationalProperties(exprhdl.Arity() - 1)->Maxcard();
}
示例4:
//---------------------------------------------------------------------------
// @function:
// CLogicalSequenceProject::Maxcard
//
// @doc:
// Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSequenceProject::Maxcard
(
IMemoryPool *, // mp
CExpressionHandle &exprhdl
)
const
{
// pass on max card of first child
return exprhdl.GetRelationalProperties(0)->Maxcard();
}
示例5:
//---------------------------------------------------------------------------
// @function:
// CPhysical::FUnaryProvidesReqdCols
//
// @doc:
// Helper for checking if output columns of a unary operator that defines
// no new columns include the required columns
//
//---------------------------------------------------------------------------
BOOL
CPhysical::FUnaryProvidesReqdCols
(
CExpressionHandle &exprhdl,
CColRefSet *pcrsRequired
)
{
GPOS_ASSERT(NULL != pcrsRequired);
CColRefSet *pcrsOutput = exprhdl.GetRelationalProperties(0 /*child_index*/)->PcrsOutput();
return pcrsOutput->ContainsAll(pcrsRequired);
}
示例6:
//---------------------------------------------------------------------------
// @function:
// CXformLeftSemiJoin2InnerJoin::Exfp
//
// @doc:
// Compute xform promise for a given expression handle;
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformLeftSemiJoin2InnerJoin::Exfp
(
CExpressionHandle &exprhdl
)
const
{
if (exprhdl.HasOuterRefs() || exprhdl.GetDrvdScalarProps(2)->FHasSubquery())
{
return ExfpNone;
}
CColRefSet *pcrsInnerOutput = exprhdl.GetRelationalProperties(1 /*child_index*/)->PcrsOutput();
CExpression *pexprScalar = exprhdl.PexprScalarChild(2 /*child_index*/);
CAutoMemoryPool amp;
// examine join predicate to determine xform applicability
if (!CPredicateUtils::FSimpleEqualityUsingCols(amp.Pmp(), pexprScalar, pcrsInnerOutput))
{
return ExfpNone;
}
return ExfpHigh;
}
示例7: CColRefSet
//---------------------------------------------------------------------------
// @function:
// CPhysicalPartitionSelectorDML::FProvidesReqdCols
//
// @doc:
// Check if required columns are included in output columns
//
//---------------------------------------------------------------------------
BOOL
CPhysicalPartitionSelectorDML::FProvidesReqdCols
(
CExpressionHandle &exprhdl,
CColRefSet *pcrsRequired,
ULONG // ulOptReq
)
const
{
GPOS_ASSERT(NULL != pcrsRequired);
GPOS_ASSERT(1 == exprhdl.Arity());
CColRefSet *pcrs = GPOS_NEW(m_mp) CColRefSet(m_mp);
// include the defined oid column
pcrs->Include(m_pcrOid);
// include output columns of the relational child
pcrs->Union(exprhdl.GetRelationalProperties(0 /*child_index*/)->PcrsOutput());
BOOL fProvidesCols = pcrs->ContainsAll(pcrsRequired);
pcrs->Release();
return fProvidesCols;
}
示例8:
//---------------------------------------------------------------------------
// @function:
// CPhysicalUnionAll::EpetPartitionPropagation
//
// @doc:
// Compute the enforcing type for the operator
//
//---------------------------------------------------------------------------
CEnfdProp::EPropEnforcingType
CPhysicalUnionAll::EpetPartitionPropagation
(
CExpressionHandle &exprhdl,
const CEnfdPartitionPropagation *pepp
)
const
{
CPartIndexMap *ppimReqd = pepp->PppsRequired()->Ppim();
if (!ppimReqd->FContainsUnresolved())
{
// no unresolved partition consumers left
return CEnfdProp::EpetUnnecessary;
}
CPartIndexMap *ppimDrvd = CDrvdPropPlan::Pdpplan(exprhdl.Pdp())->Ppim();
GPOS_ASSERT(NULL != ppimDrvd);
BOOL fInScope = pepp->FInScope(m_mp, ppimDrvd);
BOOL fResolved = pepp->FResolved(m_mp, ppimDrvd);
if (fResolved)
{
// all required partition consumers are resolved
return CEnfdProp::EpetUnnecessary;
}
if (!fInScope)
{
// some partition consumers are not covered downstream
return CEnfdProp::EpetRequired;
}
ULongPtrArray *pdrgpul = ppimReqd->PdrgpulScanIds(m_mp);
const ULONG ulScanIds = pdrgpul->Size();
const ULONG arity = exprhdl.UlNonScalarChildren();
for (ULONG ul = 0; ul < ulScanIds; ul++)
{
ULONG scan_id = *((*pdrgpul)[ul]);
ULONG ulChildrenWithConsumers = 0;
for (ULONG ulChildIdx = 0; ulChildIdx < arity; ulChildIdx++)
{
if (exprhdl.GetRelationalProperties(ulChildIdx)->Ppartinfo()->FContainsScanId(scan_id))
{
ulChildrenWithConsumers++;
}
}
if (1 < ulChildrenWithConsumers)
{
// partition consumer exists in more than one child, so enforce it here
pdrgpul->Release();
return CEnfdProp::EpetRequired;
}
}
pdrgpul->Release();
// required part propagation can be enforced here or passed to the children
return CEnfdProp::EpetOptional;
}