本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}