greenplumn CDXLScalarProjElem 源码

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

greenplumn CDXLScalarProjElem 代码

文件路径:/src/backend/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarProjElem.h

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2010 Greenplum, Inc.
//
//	@filename:
//		CDXLScalarProjElem.h
//
//	@doc:
//		Class for representing DXL projection lists.
//---------------------------------------------------------------------------



#ifndef GPDXL_CDXLScalarProjElem_H
#define GPDXL_CDXLScalarProjElem_H

#include "gpos/base.h"

#include "naucrates/dxl/operators/CDXLScalar.h"
#include "naucrates/md/CMDName.h"

namespace gpdxl
{
using namespace gpmd;

//---------------------------------------------------------------------------
//	@class:
//		CDXLScalarProjElem
//
//	@doc:
//		Container for projection list elements, storing the expression and the alias
//
//---------------------------------------------------------------------------
class CDXLScalarProjElem : public CDXLScalar
{
private:
	// id of column defined by this project element:
	// for computed columns this is a new id, for colrefs: id of the original column
	ULONG m_id;

	// alias
	const CMDName *m_mdname;

public:
	CDXLScalarProjElem(CDXLScalarProjElem &) = delete;

	// ctor/dtor
	CDXLScalarProjElem(CMemoryPool *mp, ULONG id, const CMDName *mdname);

	~CDXLScalarProjElem() override;

	// ident accessors
	Edxlopid GetDXLOperator() const override;

	// name of the operator
	const CWStringConst *GetOpNameStr() const override;

	// id of the proj element
	ULONG Id() const;

	// alias of the proj elem
	const CMDName *GetMdNameAlias() const;

	// serialize operator in DXL format
	void SerializeToDXL(CXMLSerializer *, const CDXLNode *) const override;

	// check if given column is defined by operator
	BOOL
	IsColDefined(ULONG colid) const override
	{
		return (Id() == colid);
	}

	// conversion function
	static CDXLScalarProjElem *
	Cast(CDXLOperator *dxl_op)
	{
		GPOS_ASSERT(nullptr != dxl_op);
		GPOS_ASSERT(EdxlopScalarProjectElem == dxl_op->GetDXLOperator());

		return dynamic_cast<CDXLScalarProjElem *>(dxl_op);
	}

	// does the operator return a boolean result
	BOOL
	HasBoolResult(CMDAccessor *	 //md_accessor
	) const override
	{
		GPOS_ASSERT(!"Invalid function call on a container operator");
		return false;
	}

#ifdef GPOS_DEBUG
	// checks whether the operator has valid structure
	void AssertValid(const CDXLNode *dxlnode,
					 BOOL validate_children) const override;
#endif	// GPOS_DEBUG
};
}  // namespace gpdxl

#endif	// !GPDXL_CDXLScalarProjElem_H

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CDXLColDescr 源码

greenplumn CDXLColRef 源码

greenplumn CDXLCtasStorageOptions 源码

greenplumn CDXLDatum 源码

greenplumn CDXLDatumBool 源码

greenplumn CDXLDatumGeneric 源码

greenplumn CDXLDatumInt2 源码

greenplumn CDXLDatumInt4 源码

greenplumn CDXLDatumInt8 源码

greenplumn CDXLDatumOid 源码

0  赞