greenplumn CExpressionUtils 源码

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

greenplumn CExpressionUtils 代码

文件路径:/src/backend/gporca/libgpopt/include/gpopt/operators/CExpressionUtils.h

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2014 VMware, Inc. or its affiliates.
//
//	@filename:
//		CExpressionUtils.h
//
//	@doc:
//		Utility routines for transforming expressions
//
//	@owner:
//		,
//
//	@test:
//
//---------------------------------------------------------------------------

#ifndef GPOPT_CExpressionUtils_H
#define GPOPT_CExpressionUtils_H

#include "gpos/base.h"

#include "gpopt/operators/CExpression.h"

namespace gpopt
{
using namespace gpos;

// fwd declarations
class CExpression;

//---------------------------------------------------------------------------
//	@class:
//		CExpressionUtils
//
//	@doc:
//		Utility routines for transforming expressions
//
//---------------------------------------------------------------------------
class CExpressionUtils
{
private:
	// unnest a given expression's child and append unnested nodes to given array
	static void UnnestChild(CMemoryPool *mp, CExpression *pexpr,
							ULONG UlChildIndex, BOOL fAnd, BOOL fOr,
							BOOL fNotChildren, CExpressionArray *pdrgpexpr);

	// append the unnested children of given expression to given array
	static void AppendChildren(CMemoryPool *mp, CExpression *pexpr,
							   CExpressionArray *pdrgpexpr);

	// return an array of expression children after being unnested
	static CExpressionArray *PdrgpexprUnnestChildren(CMemoryPool *mp,
													 CExpression *pexpr);

	// push not expression one level down the given expression
	static CExpression *PexprPushNotOneLevel(CMemoryPool *mp,
											 CExpression *pexpr);

public:
	// remove duplicate AND/OR children
	static CExpression *PexprDedupChildren(CMemoryPool *mp, CExpression *pexpr);

	// unnest AND/OR/NOT predicates
	static CExpression *PexprUnnest(CMemoryPool *mp, CExpression *pexpr);
};
}  // namespace gpopt

#endif	// !GPOPT_CExpressionUtils_H

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CExpression 源码

greenplumn CExpressionFactorizer 源码

greenplumn CExpressionHandle 源码

greenplumn CExpressionPreprocessor 源码

greenplumn CHashedDistributions 源码

greenplumn CLogical 源码

greenplumn CLogicalApply 源码

greenplumn CLogicalAssert 源码

greenplumn CLogicalBitmapTableGet 源码

greenplumn CLogicalCTEAnchor 源码

0  赞