greenplumn CEnfdOrder 源码

  • 2022-08-18
  • 浏览 (459)

greenplumn CEnfdOrder 代码

文件路径:/src/backend/gporca/libgpopt/include/gpopt/base/CEnfdOrder.h

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2011 EMC Corp.
//
//	@filename:
//		CEnfdOrder.h
//
//	@doc:
//		Enforceable order property
//---------------------------------------------------------------------------
#ifndef GPOPT_CEnfdOrder_H
#define GPOPT_CEnfdOrder_H

#include "gpos/base.h"

#include "gpopt/base/CEnfdProp.h"
#include "gpopt/base/COrderSpec.h"


namespace gpopt
{
using namespace gpos;

// prototypes
class CPhysical;


//---------------------------------------------------------------------------
//	@class:
//		CEnfdOrder
//
//	@doc:
//		Enforceable order property;
//
//---------------------------------------------------------------------------
class CEnfdOrder : public CEnfdProp
{
public:
	// type of order matching function
	enum EOrderMatching
	{
		EomSatisfy = 0,

		EomSentinel
	};

private:
	// required sort order
	COrderSpec *m_pos;

	// order matching type
	EOrderMatching m_eom;

	// names of order matching types
	static const CHAR *m_szOrderMatching[EomSentinel];

public:
	CEnfdOrder(const CEnfdOrder &) = delete;

	// ctor
	CEnfdOrder(COrderSpec *pos, EOrderMatching eom);

	// dtor
	~CEnfdOrder() override;

	// hash function
	ULONG HashValue() const override;

	// check if the given order specification is compatible with the
	// order specification of this object for the specified matching type
	BOOL FCompatible(COrderSpec *pos) const;

	// required order accessor
	COrderSpec *
	PosRequired() const
	{
		return m_pos;
	}

	// get order enforcing type for the given operator
	EPropEnforcingType Epet(CExpressionHandle &exprhdl, CPhysical *popPhysical,
							BOOL fOrderReqd) const;

	// property spec accessor
	CPropSpec *
	Pps() const override
	{
		return m_pos;
	}

	// return matching type
	EOrderMatching
	Eom() const
	{
		return m_eom;
	}

	// matching function
	BOOL
	Matches(CEnfdOrder *peo)
	{
		GPOS_ASSERT(nullptr != peo);

		return m_eom == peo->Eom() && m_pos->Matches(peo->PosRequired());
	}

	// print function
	IOstream &OsPrint(IOstream &os) const override;

};	// class CEnfdOrder

}  // namespace gpopt


#endif	// !GPOPT_CEnfdOrder_H

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CAutoOptCtxt 源码

greenplumn CCTEInfo 源码

greenplumn CCTEMap 源码

greenplumn CCTEReq 源码

greenplumn CCastUtils 源码

greenplumn CColConstraintsArrayMapper 源码

greenplumn CColConstraintsHashMapper 源码

greenplumn CColRef 源码

greenplumn CColRefComputed 源码

greenplumn CColRefSet 源码

0  赞