greenplumn CHashedDistributions 源码
greenplumn CHashedDistributions 代码
文件路径:/src/backend/gporca/libgpopt/src/operators/CHashedDistributions.cpp
// Greenplum Database
// Copyright (C) 2016 VMware, Inc. or its affiliates.
#include "gpopt/operators/CHashedDistributions.h"
#include "gpopt/base/CUtils.h"
using namespace gpopt;
CHashedDistributions::CHashedDistributions(CMemoryPool *mp,
CColRefArray *pdrgpcrOutput,
CColRef2dArray *pdrgpdrgpcrInput)
: CDistributionSpecArray(mp)
{
const ULONG num_cols = pdrgpcrOutput->Size();
const ULONG arity = pdrgpdrgpcrInput->Size();
for (ULONG ulChild = 0; ulChild < arity; ulChild++)
{
CColRefArray *colref_array = (*pdrgpdrgpcrInput)[ulChild];
CExpressionArray *pdrgpexpr = GPOS_NEW(mp) CExpressionArray(mp);
for (ULONG ulCol = 0; ulCol < num_cols; ulCol++)
{
CColRef *colref = (*colref_array)[ulCol];
CExpression *pexpr = CUtils::PexprScalarIdent(mp, colref);
pdrgpexpr->Append(pexpr);
}
// create a hashed distribution on input columns of the current child
BOOL fNullsColocated = true;
CDistributionSpec *pdshashed =
GPOS_NEW(mp) CDistributionSpecHashed(pdrgpexpr, fNullsColocated);
Append(pdshashed);
}
}
相关信息
相关文章
greenplumn CExpressionFactorizer 源码
greenplumn CExpressionHandle 源码
greenplumn CExpressionPreprocessor 源码
greenplumn CExpressionUtils 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦