greenplumn CDXLDatumOid 源码

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

greenplumn CDXLDatumOid 代码

文件路径:/src/backend/gporca/libnaucrates/src/operators/CDXLDatumOid.cpp

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2012 EMC Corp.
//
//	@filename:
//		CDXLDatumOid.cpp
//
//	@doc:
//		Implementation of DXL datum of type oid
//
//	@owner:
//
//
//	@test:
//
//---------------------------------------------------------------------------

#include "naucrates/dxl/operators/CDXLDatumOid.h"

#include "naucrates/dxl/xml/CXMLSerializer.h"

using namespace gpos;
using namespace gpdxl;

//---------------------------------------------------------------------------
//	@function:
//		CDXLDatumOid::CDXLDatumOid
//
//	@doc:
//		Ctor
//
//---------------------------------------------------------------------------
CDXLDatumOid::CDXLDatumOid(CMemoryPool *mp, IMDId *mdid_type, BOOL is_null,
						   OID oid_val)
	: CDXLDatum(mp, mdid_type, default_type_modifier, is_null, 4 /*length*/),
	  m_oid_val(oid_val)
{
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLDatumOid::OidValue
//
//	@doc:
//		Return the oid value
//
//---------------------------------------------------------------------------
OID
CDXLDatumOid::OidValue() const
{
	return m_oid_val;
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLDatumOid::Serialize
//
//	@doc:
//		Serialize datum in DXL format
//
//---------------------------------------------------------------------------
void
CDXLDatumOid::Serialize(CXMLSerializer *xml_serializer)
{
	m_mdid_type->Serialize(xml_serializer,
						   CDXLTokens::GetDXLTokenStr(EdxltokenTypeId));

	if (!m_is_null)
	{
		xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenValue),
									 m_oid_val);
	}
	else
	{
		xml_serializer->AddAttribute(
			CDXLTokens::GetDXLTokenStr(EdxltokenIsNull), true);
	}
}

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CDXLColDescr 源码

greenplumn CDXLColRef 源码

greenplumn CDXLCtasStorageOptions 源码

greenplumn CDXLDatum 源码

greenplumn CDXLDatumBool 源码

greenplumn CDXLDatumGeneric 源码

greenplumn CDXLDatumInt2 源码

greenplumn CDXLDatumInt4 源码

greenplumn CDXLDatumInt8 源码

greenplumn CDXLDatumStatsDoubleMappable 源码

0  赞