本文整理汇总了C++中CDXLNode::UlArity方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXLNode::UlArity方法的具体用法?C++ CDXLNode::UlArity怎么用?C++ CDXLNode::UlArity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXLNode
的用法示例。
在下文中一共展示了CDXLNode::UlArity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CDXLLogicalProject::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLLogicalProject::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
GPOS_ASSERT(2 == pdxln->UlArity());
CDXLNode *pdxlnProjList = (*pdxln)[0];
CDXLNode *pdxlnChild = (*pdxln)[1];
GPOS_ASSERT(EdxlopScalarProjectList == pdxlnProjList->Pdxlop()->Edxlop());
GPOS_ASSERT(EdxloptypeLogical == pdxlnChild->Pdxlop()->Edxloperatortype());
if (fValidateChildren)
{
pdxlnProjList->Pdxlop()->AssertValid(pdxlnProjList, fValidateChildren);
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
const ULONG ulArity = pdxlnProjList->UlArity();
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnPrEl = (*pdxlnProjList)[ul];
GPOS_ASSERT(EdxlopScalarIdent != pdxlnPrEl->Pdxlop()->Edxlop());
}
}
示例2:
//---------------------------------------------------------------------------
// @function:
// CDXLPhysicalSort::AssertValid
//
// @doc:
// Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLPhysicalSort::AssertValid
(
const CDXLNode *pdxln,
BOOL fValidateChildren
) const
{
// assert proj list and filter are valid
CDXLPhysical::AssertValid(pdxln, fValidateChildren);
GPOS_ASSERT(EdxlsortIndexSentinel == pdxln->UlArity());
CDXLNode *pdxlnSortColList = (*pdxln)[EdxlsortIndexSortColList];
CDXLNode *pdxlnChild = (*pdxln)[EdxlsortIndexChild];
CDXLNode *pdxlnLimitCount = (*pdxln)[EdxlsortIndexLimitCount];
CDXLNode *pdxlnLimitOffset = (*pdxln)[EdxlsortIndexLimitOffset];
// assert children are of right type (physical/scalar)
GPOS_ASSERT(EdxloptypeScalar == pdxlnSortColList->Pdxlop()->Edxloperatortype());
GPOS_ASSERT(EdxloptypePhysical == pdxlnChild->Pdxlop()->Edxloperatortype());
GPOS_ASSERT(EdxlopScalarLimitCount == pdxlnLimitCount->Pdxlop()->Edxlop());
GPOS_ASSERT(EdxlopScalarLimitOffset == pdxlnLimitOffset->Pdxlop()->Edxlop());
// there must be at least one sorting column
GPOS_ASSERT(pdxlnSortColList->UlArity() > 0);
if (fValidateChildren)
{
pdxlnSortColList->Pdxlop()->AssertValid(pdxlnSortColList, fValidateChildren);
pdxlnChild->Pdxlop()->AssertValid(pdxlnChild, fValidateChildren);
}
}
示例3: MakeNode
//---------------------------------------------------------------------------
// @function:
// CTranslatorDXLToQuery::TranslateProjList
//
// @doc:
// Translates a DXL projection list
//
//---------------------------------------------------------------------------
void
CTranslatorDXLToQuery::TranslateProjList
(
const CDXLNode *pdxlnPrL,
CStateDXLToQuery *pstatedxltoquery,
CMappingColIdVarQuery *pmapcidvarquery,
ULONG ulTargetEntryIndex
)
{
if (NULL != pdxlnPrL)
{
// translate each DXL project element into a target entry
const ULONG ulArity = pdxlnPrL->UlArity();
for (ULONG ul = 0; ul < ulArity; ++ul)
{
CDXLNode *pdxlnPrEl = (*pdxlnPrL)[ul];
CDXLScalarProjElem *pdxlopPrEl = CDXLScalarProjElem::PdxlopConvert(pdxlnPrEl->Pdxlop());
GPOS_ASSERT(1 == pdxlnPrEl->UlArity());
// translate proj element expression
CDXLNode *pdxlnExpr = (*pdxlnPrEl)[0];
Expr *pexpr = m_pdxlsctranslator->PexprFromDXLNodeScalar(pdxlnExpr, pmapcidvarquery);
GPOS_ASSERT(NULL != pexpr);
TargetEntry *pte = MakeNode(TargetEntry);
pte->expr = pexpr;
pte->resname = CTranslatorUtils::SzFromWsz(pdxlopPrEl->PmdnameAlias()->Pstr()->Wsz());
pte->resno = (AttrNumber) (ulTargetEntryIndex + ul + 1);
pstatedxltoquery->AddOutputColumnEntry(pte, pte->resname, pdxlopPrEl->UlId());
//save mapping col id -> Var in the query translation context
pmapcidvarquery->FInsertMapping(pdxlopPrEl->UlId(), pte);
}
}
}