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


C++ CExpressionHandle::PexprScalarChild方法代码示例

本文整理汇总了C++中CExpressionHandle::PexprScalarChild方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpressionHandle::PexprScalarChild方法的具体用法?C++ CExpressionHandle::PexprScalarChild怎么用?C++ CExpressionHandle::PexprScalarChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CExpressionHandle的用法示例。


在下文中一共展示了CExpressionHandle::PexprScalarChild方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalAssert::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalAssert::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	// in case of a false condition or a contradiction, maxcard should be 1
	CExpression *pexprScalar = exprhdl.PexprScalarChild(1);
	GPOS_ASSERT(NULL != pexprScalar);

	if (CUtils::FScalarConstFalse(pexprScalar) ||
		CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction())
	{
		return CMaxCard(1 /*ull*/);
	}

	// if Assert operator was generated from MaxOneRow operator,
	// then a max cardinality of 1 is expected
	if (NULL != exprhdl.Pgexpr() &&
		CXform::ExfMaxOneRow2Assert == exprhdl.Pgexpr()->ExfidOrigin())
	{
		return CMaxCard(1 /*ull*/);
	}

	// pass on max card of first child
	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:37,代码来源:CLogicalAssert.cpp

示例2:

//---------------------------------------------------------------------------
//	@function:
//		CXformPushDownLeftOuterJoin::Exfp
//
//	@doc:
//		Xform promise
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformPushDownLeftOuterJoin::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	CExpression *pexprScalar = exprhdl.PexprScalarChild(2);
	if (COperator::EopScalarConst == pexprScalar->Pop()->Eopid())
	{
		return CXform::ExfpNone;
	}
	return CXform::ExfpHigh;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:22,代码来源:CXformPushDownLeftOuterJoin.cpp

示例3:

//---------------------------------------------------------------------------
//	@function:
//		CXformSimplifyLeftOuterJoin::Exfp
//
//	@doc:
//		Compute xform promise for a given expression handle
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformSimplifyLeftOuterJoin::Exfp
	(
	CExpressionHandle &exprhdl
	)
	const
{
	CExpression *pexprScalar = exprhdl.PexprScalarChild(2 /*ulChildIndex*/);
	if (CUtils::FScalarConstFalse(pexprScalar))
	{
		// if LOJ predicate is False, we can replace inner child with empty table
		return CXform::ExfpHigh;
	}

	return CXform::ExfpNone;
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:24,代码来源:CXformSimplifyLeftOuterJoin.cpp

示例4: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalSelect::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalSelect::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	// in case of a false condition or a contradiction, maxcard should be zero
	CExpression *pexprScalar = exprhdl.PexprScalarChild(1);
	if ((NULL != pexprScalar && CUtils::FScalarConstFalse(pexprScalar)) ||
		CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction())
	{
		return CMaxCard(0 /*ull*/);
	}

	// pass on max card of first child
	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:d,项目名称:gporca,代码行数:27,代码来源:CLogicalSelect.cpp

示例5: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogicalLimit::Maxcard
//
//	@doc:
//		Derive max card
//
//---------------------------------------------------------------------------
CMaxCard
CLogicalLimit::Maxcard
	(
	IMemoryPool *, // pmp
	CExpressionHandle &exprhdl
	)
	const
{
	CExpression *pexprCount = exprhdl.PexprScalarChild(2 /*ulChildIndex*/);
	if (CUtils::FScalarConstInt<IMDTypeInt8>(pexprCount))
	{
		CScalarConst *popScalarConst = CScalarConst::PopConvert(pexprCount->Pop());
		IDatumInt8 *pdatumInt8 = dynamic_cast<IDatumInt8 *>(popScalarConst->Pdatum());

		return CMaxCard(pdatumInt8->LValue());
	}

	// pass on max card of first child
	return exprhdl.Pdprel(0)->Maxcard();
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:28,代码来源:CLogicalLimit.cpp

示例6: CMaxCard

//---------------------------------------------------------------------------
//	@function:
//		CLogical::Maxcard
//
//	@doc:
//		Derive max card given scalar child and constraint property. If a
//		contradiction is detected then return maxcard of zero, otherwise
//		use the given default maxcard
//
//---------------------------------------------------------------------------
CMaxCard
CLogical::Maxcard
	(
	CExpressionHandle &exprhdl,
	ULONG ulScalarIndex,
	CMaxCard maxcard
	)
{
	// in case of a false condition or a contradiction, maxcard should be zero
	CExpression *pexprScalar = exprhdl.PexprScalarChild(ulScalarIndex);

	if (NULL != pexprScalar &&
		(CUtils::FScalarConstFalse(pexprScalar) ||
		CDrvdPropRelational::Pdprel(exprhdl.Pdp())->Ppc()->FContradiction()))
	{
		return CMaxCard(0 /*ull*/);
	}

	return maxcard;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:30,代码来源:CLogical.cpp

示例7:

//---------------------------------------------------------------------------
//	@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;
}
开发者ID:b-xiang,项目名称:gporca,代码行数:32,代码来源:CXformLeftSemiJoin2InnerJoin.cpp


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