greenplumn CPhysicalHashAgg 源码

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

greenplumn CPhysicalHashAgg 代码

文件路径:/src/backend/gporca/libgpopt/include/gpopt/operators/CPhysicalHashAgg.h

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2009 Greenplum, Inc.
//
//	@filename:
//		CPhysicalHashAgg.h
//
//	@doc:
//		Hash Aggregate operator
//---------------------------------------------------------------------------
#ifndef GPOS_CPhysicalHashAgg_H
#define GPOS_CPhysicalHashAgg_H

#include "gpos/base.h"

#include "gpopt/operators/CPhysicalAgg.h"

namespace gpopt
{
// fwd declaration
class CDistributionSpec;

//---------------------------------------------------------------------------
//	@class:
//		CPhysicalHashAgg
//
//	@doc:
//		Hash-based aggregate operator
//
//---------------------------------------------------------------------------
class CPhysicalHashAgg : public CPhysicalAgg
{
private:
public:
	CPhysicalHashAgg(const CPhysicalHashAgg &) = delete;

	// ctor
	CPhysicalHashAgg(CMemoryPool *mp, CColRefArray *colref_array,
					 CColRefArray *pdrgpcrMinimal,
					 COperator::EGbAggType egbaggtype,
					 BOOL fGeneratesDuplicates, CColRefArray *pdrgpcrArgDQA,
					 BOOL fMultiStage, BOOL isAggFromSplitDQA,
					 CLogicalGbAgg::EAggStage aggStage,
					 BOOL should_enforce_distribution = true
					 // should_enforce_distribution should be set to false if
					 // 'local' and 'global' splits don't need to have different
					 // distributions. This flag is set to false if the local
					 // aggregate has been created by CXformEagerAgg.
	);

	// dtor
	~CPhysicalHashAgg() override;


	// ident accessors
	EOperatorId
	Eopid() const override
	{
		return EopPhysicalHashAgg;
	}

	// return a string for operator name
	const CHAR *
	SzId() const override
	{
		return "CPhysicalHashAgg";
	}

	//-------------------------------------------------------------------------------------
	// Required Plan Properties
	//-------------------------------------------------------------------------------------

	// compute required sort columns of the n-th child
	COrderSpec *PosRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
							COrderSpec *posRequired, ULONG child_index,
							CDrvdPropArray *pdrgpdpCtxt,
							ULONG ulOptReq) const override;

	//-------------------------------------------------------------------------------------
	// Derived Plan Properties
	//-------------------------------------------------------------------------------------

	// derive sort order
	COrderSpec *PosDerive(CMemoryPool *mp,
						  CExpressionHandle &exprhdl) const override;

	//-------------------------------------------------------------------------------------
	// Enforced Properties
	//-------------------------------------------------------------------------------------

	// return order property enforcing type for this operator
	CEnfdProp::EPropEnforcingType EpetOrder(
		CExpressionHandle &exprhdl, const CEnfdOrder *peo) const override;

	//-------------------------------------------------------------------------------------
	//-------------------------------------------------------------------------------------
	//-------------------------------------------------------------------------------------

	// conversion function
	static CPhysicalHashAgg *
	PopConvert(COperator *pop)
	{
		GPOS_ASSERT(nullptr != pop);
		GPOS_ASSERT(EopPhysicalHashAgg == pop->Eopid() ||
					EopPhysicalHashAggDeduplicate == pop->Eopid());

		return dynamic_cast<CPhysicalHashAgg *>(pop);
	}

};	// class CPhysicalHashAgg

}  // namespace gpopt


#endif	// !GPOS_CPhysicalHashAgg_H

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CExpression 源码

greenplumn CExpressionFactorizer 源码

greenplumn CExpressionHandle 源码

greenplumn CExpressionPreprocessor 源码

greenplumn CExpressionUtils 源码

greenplumn CHashedDistributions 源码

greenplumn CLogical 源码

greenplumn CLogicalApply 源码

greenplumn CLogicalAssert 源码

greenplumn CLogicalBitmapTableGet 源码

0  赞