当前位置: 首页>>代码示例>>C++>>正文


C++ CDXLNode::UlArity方法代码示例

本文整理汇总了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());
	}
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:36,代码来源:CDXLLogicalProject.cpp

示例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);
	}
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:40,代码来源:CDXLPhysicalSort.cpp

示例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);
		}
	}
}
开发者ID:ricky-wu,项目名称:gpdb,代码行数:45,代码来源:CTranslatorDXLToQuery.cpp


注:本文中的CDXLNode::UlArity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。