greenplumn CScalarIf 代码
文件路径:/src/backend/gporca/libgpopt/src/operators/CScalarIf.cpp
/---------------------------------------------------------------------------
/ Greenplum Database
/ Copyright (C) 2011 EMC Corp.
/
/ @filename:
/ CScalarIf.cpp
/
/ @doc:
/ Implementation of scalar if operator
/---------------------------------------------------------------------------
#include "gpopt/operators/CScalarIf.h"
#include "gpos/base.h"
#include "gpopt/base/CColRefSet.h"
#include "gpopt/base/CDrvdPropScalar.h"
#include "gpopt/base/COptCtxt.h"
#include "gpopt/mdcache/CMDAccessorUtils.h"
#include "gpopt/operators/CExpressionHandle.h"
#include "naucrates/md/IMDTypeBool.h"
using namespace gpopt;
using namespace gpmd;
/---------------------------------------------------------------------------
/ @function:
/ CScalarIf::CScalarIf
/
/ @doc:
/ Ctor
/
/---------------------------------------------------------------------------
CScalarIf::CScalarIf(CMemoryPool *mp, IMDId *mdid)
: CScalar(mp), m_mdid_type(mdid), m_fBoolReturnType(false)
{
GPOS_ASSERT(mdid->IsValid());
CMDAccessor *md_accessor = COptCtxt::PoctxtFromTLS()->Pmda();
m_fBoolReturnType = CMDAccessorUtils::FBoolType(md_accessor, m_mdid_type);
}
/---------------------------------------------------------------------------
/ @function:
/ CScalarIf::HashValue
/
/ @doc:
/ Operator specific hash function; combined hash of operator id and
/ return type id
/
/---------------------------------------------------------------------------
ULONG
CScalarIf::HashValue() const
{
return gpos::CombineHashes(COperator::HashValue(),
m_mdid_type->HashValue());
}
/---------------------------------------------------------------------------
/ @function:
/ CScalarIf::Matches
/
/ @doc:
/ Match function on operator level
/
/---------------------------------------------------------------------------
BOOL
CScalarIf::Matches(COperator *pop) const
{
if (pop->Eopid() == Eopid())
{
CScalarIf *popScIf = CScalarIf::PopConvert(pop);
/ match if return types are identical
return popScIf->MdidType()->Equals(m_mdid_type);
}
return false;
}
/ EOF
相关信息
相关文章
greenplumn CExpressionFactorizer 源码
greenplumn CExpressionHandle 源码
greenplumn CExpressionPreprocessor 源码
greenplumn CExpressionUtils 源码