Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
350ca788
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
350ca788
编写于
6月 30, 2017
作者:
V
Venkatesh Raghavan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor the code in CPredicateUtils
Minor cleaniup of duplicate code.
上级
b46380ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
67 deletion
+19
-67
CMakeLists.txt
CMakeLists.txt
+1
-1
libgpopt/include/gpopt/operators/CPredicateUtils.h
libgpopt/include/gpopt/operators/CPredicateUtils.h
+5
-5
libgpopt/src/operators/CPredicateUtils.cpp
libgpopt/src/operators/CPredicateUtils.cpp
+11
-59
libnaucrates/src/statistics/CStatsPredUtils.cpp
libnaucrates/src/statistics/CStatsPredUtils.cpp
+2
-2
未找到文件。
CMakeLists.txt
浏览文件 @
350ca788
...
...
@@ -5,7 +5,7 @@ project(gpopt LANGUAGES CXX C)
set
(
GPORCA_VERSION_MAJOR 2
)
set
(
GPORCA_VERSION_MINOR 34
)
set
(
GPORCA_VERSION_PATCH
2
)
set
(
GPORCA_VERSION_PATCH
3
)
set
(
GPORCA_VERSION_STRING
"
${
GPORCA_VERSION_MAJOR
}
.
${
GPORCA_VERSION_MINOR
}
.
${
GPORCA_VERSION_PATCH
}
"
)
# Whenever an ABI-breaking change is made to GPORCA, this should be incremented.
...
...
libgpopt/include/gpopt/operators/CPredicateUtils.h
浏览文件 @
350ca788
...
...
@@ -194,6 +194,11 @@ namespace gpopt
static
CExpression
*
PexprINDFConjunction
(
IMemoryPool
*
pmp
,
DrgPcr
*
pdrgpcrFirst
,
DrgPcr
*
pdrgpcrSecond
);
// is the given expression of the form (col CMP/IS DISTINCT/IS NOT DISTINCT FROM FROM constant)
// either the constant or the column can be casted
static
BOOL
FIdentCompareConstIgnoreCast
(
CExpression
*
pexpr
,
COperator
::
EOperatorId
);
// is the given expression of the form (col IS DISTINCT FROM constant)
// either the constant or the column can be casted
static
...
...
@@ -208,11 +213,6 @@ namespace gpopt
static
BOOL
FCompareIdentToConst
(
CExpression
*
pexpr
);
// is the given expression of the form (col comparison constant).
// either the constant or the column can be casted
static
BOOL
FIdentCmpConstIgnoreCast
(
CExpression
*
pexpr
);
// checks if comparison is between two columns, or a column and a const
static
BOOL
FCompareColToConstOrCol
(
CExpression
*
pexprScalar
);
...
...
libgpopt/src/operators/CPredicateUtils.cpp
浏览文件 @
350ca788
...
...
@@ -1398,76 +1398,28 @@ CPredicateUtils::FCompareIdentToConst
return
true
;
}
//---------------------------------------------------------------------------
// @function:
// CPredicateUtils::FIdentCmpConstIgnoreCast
//
// @doc:
// Is the given expression of the form (col cmp constant)
// ignoring casting on either sides
//---------------------------------------------------------------------------
// is the given expression is of the form (col IS DISTINCT FROM const)
// ignoring cast on either sides
BOOL
CPredicateUtils
::
FIdent
Cmp
ConstIgnoreCast
(
CPredicateUtils
::
FIdent
IDF
ConstIgnoreCast
(
CExpression
*
pexpr
)
{
COperator
*
pop
=
pexpr
->
Pop
();
if
(
COperator
::
EopScalarCmp
!=
pop
->
Eopid
())
{
return
false
;
}
CExpression
*
pexprLeft
=
(
*
pexpr
)[
0
];
CExpression
*
pexprRight
=
(
*
pexpr
)[
1
];
// col cmp const
if
(
COperator
::
EopScalarIdent
==
pexprLeft
->
Pop
()
->
Eopid
()
&&
COperator
::
EopScalarConst
==
pexprRight
->
Pop
()
->
Eopid
())
{
return
true
;
}
// cast(col) cmp const
if
(
CScalarIdent
::
FCastedScId
(
pexprLeft
)
&&
COperator
::
EopScalarConst
==
pexprRight
->
Pop
()
->
Eopid
())
{
return
true
;
}
// col cmp cast(constant)
if
(
COperator
::
EopScalarIdent
==
pexprLeft
->
Pop
()
->
Eopid
()
&&
CScalarConst
::
FCastedConst
(
pexprRight
))
{
return
true
;
}
// cast(col) cmp cast(constant)
if
(
CScalarIdent
::
FCastedScId
(
pexprLeft
)
&&
CScalarConst
::
FCastedConst
(
pexprRight
))
{
return
true
;
}
return
false
;
return
FIdentCompareConstIgnoreCast
(
pexpr
,
COperator
::
EopScalarIsDistinctFrom
);
}
//---------------------------------------------------------------------------
// @function:
// CPredicateUtils::FIdentIDFConstIgnoreCast
//
// @doc:
// Is the given expression is of the form (col IS DISTINCT FROM const)
// ignoring cast on either sides
//---------------------------------------------------------------------------
// is the given expression of the form (col cmp constant) ignoring casting on either sides
BOOL
CPredicateUtils
::
FIdent
IDF
ConstIgnoreCast
CPredicateUtils
::
FIdent
Compare
ConstIgnoreCast
(
CExpression
*
pexpr
CExpression
*
pexpr
,
COperator
::
EOperatorId
eopid
)
{
COperator
*
pop
=
pexpr
->
Pop
();
if
(
COperator
::
EopScalarIsDistinctFrom
!=
pop
->
Eopid
())
if
(
eopid
!=
pop
->
Eopid
())
{
return
false
;
}
...
...
@@ -1522,7 +1474,7 @@ CPredicateUtils::FIdentINDFConstIgnoreCast
return
false
;
}
return
FIdent
IDFConstIgnoreCast
((
*
pexpr
)[
0
]
);
return
FIdent
CompareConstIgnoreCast
((
*
pexpr
)[
0
],
COperator
::
EopScalarIsDistinctFrom
);
}
//---------------------------------------------------------------------------
...
...
libnaucrates/src/statistics/CStatsPredUtils.cpp
浏览文件 @
350ca788
...
...
@@ -274,7 +274,7 @@ CStatsPredUtils::Pstatspred
pexprLeft
=
(
*
pexpr
)[
0
];
pexprRight
=
(
*
pexpr
)[
1
];
GPOS_ASSERT
(
CPredicateUtils
::
FIdentC
mpConstIgnoreCast
(
pexpr
));
GPOS_ASSERT
(
CPredicateUtils
::
FIdentC
ompareConstIgnoreCast
(
pexpr
,
COperator
::
EopScalarCmp
));
COperator
*
pop
=
pexpr
->
Pop
();
CScalarCmp
*
popScCmp
=
CScalarCmp
::
PopConvert
(
pop
);
...
...
@@ -724,7 +724,7 @@ CStatsPredUtils::FPointPredicate
)
{
GPOS_ASSERT
(
NULL
!=
pexprPred
);
return
(
CPredicateUtils
::
FIdentC
mpConstIgnoreCast
(
pexprPred
));
return
(
CPredicateUtils
::
FIdentC
ompareConstIgnoreCast
(
pexprPred
,
COperator
::
EopScalarCmp
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录