greenplumn CXformExternalGet2ExternalScan 源码
greenplumn CXformExternalGet2ExternalScan 代码
文件路径:/src/backend/gporca/libgpopt/src/xforms/CXformExternalGet2ExternalScan.cpp
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2013 VMware, Inc. or its affiliates.
//
// @filename:
// CXformExternalGet2ExternalScan.cpp
//
// @doc:
// Implementation of transform
//---------------------------------------------------------------------------
#include "gpopt/xforms/CXformExternalGet2ExternalScan.h"
#include "gpos/base.h"
#include "gpopt/metadata/CTableDescriptor.h"
#include "gpopt/operators/CLogicalExternalGet.h"
#include "gpopt/operators/CPhysicalExternalScan.h"
using namespace gpopt;
//---------------------------------------------------------------------------
// @function:
// CXformExternalGet2ExternalScan::CXformExternalGet2ExternalScan
//
// @doc:
// Ctor
//
//---------------------------------------------------------------------------
CXformExternalGet2ExternalScan::CXformExternalGet2ExternalScan(CMemoryPool *mp)
: CXformImplementation(
// pattern
GPOS_NEW(mp) CExpression(mp, GPOS_NEW(mp) CLogicalExternalGet(mp)))
{
}
//---------------------------------------------------------------------------
// @function:
// CXformExternalGet2ExternalScan::Exfp
//
// @doc:
// Compute promise of xform
//
//---------------------------------------------------------------------------
CXform::EXformPromise
CXformExternalGet2ExternalScan::Exfp(CExpressionHandle & //exprhdl
) const
{
return CXform::ExfpHigh;
}
//---------------------------------------------------------------------------
// @function:
// CXformExternalGet2ExternalScan::Transform
//
// @doc:
// Actual transformation
//
//---------------------------------------------------------------------------
void
CXformExternalGet2ExternalScan::Transform(CXformContext *pxfctxt,
CXformResult *pxfres,
CExpression *pexpr) const
{
GPOS_ASSERT(nullptr != pxfctxt);
GPOS_ASSERT(FPromising(pxfctxt->Pmp(), this, pexpr));
GPOS_ASSERT(FCheckPattern(pexpr));
CLogicalExternalGet *popGet = CLogicalExternalGet::PopConvert(pexpr->Pop());
CMemoryPool *mp = pxfctxt->Pmp();
// extract components for alternative
CName *pname = GPOS_NEW(mp) CName(mp, popGet->Name());
CTableDescriptor *ptabdesc = popGet->Ptabdesc();
ptabdesc->AddRef();
CColRefArray *pdrgpcrOutput = popGet->PdrgpcrOutput();
GPOS_ASSERT(nullptr != pdrgpcrOutput);
pdrgpcrOutput->AddRef();
// create alternative expression
CExpression *pexprAlt = GPOS_NEW(mp) CExpression(
mp,
GPOS_NEW(mp) CPhysicalExternalScan(mp, pname, ptabdesc, pdrgpcrOutput));
// add alternative to transformation result
pxfres->Add(pexprAlt);
}
// EOF
相关信息
相关文章
greenplumn CJoinOrderGreedy 源码
greenplumn CJoinOrderMinCard 源码
greenplumn CSubqueryHandler 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
7、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦