greenplumn CPhysicalUnionAllFactory 源码

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

greenplumn CPhysicalUnionAllFactory 代码

文件路径:/src/backend/gporca/libgpopt/src/operators/CPhysicalUnionAllFactory.cpp

//	Greenplum Database
//	Copyright (C) 2016 VMware, Inc. or its affiliates.


#include "gpopt/operators/CPhysicalUnionAllFactory.h"

#include "gpos/base.h"

#include "gpopt/exception.h"
#include "gpopt/operators/CPhysicalParallelUnionAll.h"
#include "gpopt/operators/CPhysicalSerialUnionAll.h"
#include "gpopt/xforms/CXformUtils.h"

namespace gpopt
{
CPhysicalUnionAllFactory::CPhysicalUnionAllFactory(
	CLogicalUnionAll *popLogicalUnionAll)
	: m_popLogicalUnionAll(popLogicalUnionAll)
{
}

CPhysicalUnionAll *
CPhysicalUnionAllFactory::PopPhysicalUnionAll(CMemoryPool *mp, BOOL fParallel)
{
	CColRefArray *pdrgpcrOutput = m_popLogicalUnionAll->PdrgpcrOutput();
	CColRef2dArray *pdrgpdrgpcrInput = m_popLogicalUnionAll->PdrgpdrgpcrInput();

	// TODO:  May 2nd 2012; support compatible types
	if (!CXformUtils::FSameDatatype(pdrgpdrgpcrInput))
	{
		GPOS_RAISE(gpopt::ExmaGPOPT, gpopt::ExmiUnsupportedOp,
				   GPOS_WSZ_LIT("Union of non-identical types"));
	}

	pdrgpcrOutput->AddRef();
	pdrgpdrgpcrInput->AddRef();

	if (fParallel)
	{
		return GPOS_NEW(mp)
			CPhysicalParallelUnionAll(mp, pdrgpcrOutput, pdrgpdrgpcrInput);
	}
	else
	{
		return GPOS_NEW(mp)
			CPhysicalSerialUnionAll(mp, pdrgpcrOutput, pdrgpdrgpcrInput);
	}
}

}  // namespace gpopt

相关信息

greenplumn 源码目录

相关文章

greenplumn CExpression 源码

greenplumn CExpressionFactorizer 源码

greenplumn CExpressionHandle 源码

greenplumn CExpressionPreprocessor 源码

greenplumn CExpressionUtils 源码

greenplumn CHashedDistributions 源码

greenplumn CLogical 源码

greenplumn CLogicalApply 源码

greenplumn CLogicalAssert 源码

greenplumn CLogicalBitmapTableGet 源码

0  赞