Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e1943fd6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e1943fd6
编写于
2月 24, 2022
作者:
X
xiao-yu-wang
提交者:
GitHub
2月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10389 from taosdata/feature/3.0_wxy
TD-13495 physical plan refactoring
上级
5ee328d1
2fb0af81
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
337 addition
and
172 deletion
+337
-172
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+3
-2
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+14
-2
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+9
-7
source/libs/nodes/src/nodesCloneFuncs.c
source/libs/nodes/src/nodesCloneFuncs.c
+0
-10
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+0
-26
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+4
-2
source/libs/planner/src/plannerImpl.c
source/libs/planner/src/plannerImpl.c
+266
-84
source/libs/planner/test/newPlannerTest.cpp
source/libs/planner/test/newPlannerTest.cpp
+2
-2
source/libs/scalar/inc/filterInt.h
source/libs/scalar/inc/filterInt.h
+5
-5
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+12
-12
source/libs/scalar/src/scalar.c
source/libs/scalar/src/scalar.c
+7
-5
source/libs/scalar/test/filter/filterTests.cpp
source/libs/scalar/test/filter/filterTests.cpp
+9
-9
source/libs/scalar/test/scalar/scalarTests.cpp
source/libs/scalar/test/scalar/scalarTests.cpp
+6
-6
未找到文件。
include/libs/nodes/nodes.h
浏览文件 @
e1943fd6
...
...
@@ -62,7 +62,6 @@ typedef enum ENodeType {
QUERY_NODE_NODE_LIST
,
QUERY_NODE_FILL
,
QUERY_NODE_RAW_EXPR
,
// Only be used in parser module.
QUERY_NODE_COLUMN_REF
,
QUERY_NODE_TARGET
,
QUERY_NODE_TUPLE_DESC
,
QUERY_NODE_SLOT_DESC
,
...
...
@@ -81,7 +80,9 @@ typedef enum ENodeType {
// physical plan node
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
QUERY_NODE_PHYSICAL_PLAN_PROJECT
,
QUERY_NODE_PHYSICAL_PLAN_JOIN
,
QUERY_NODE_PHYSICAL_PLAN_AGG
}
ENodeType
;
/**
...
...
include/libs/nodes/plannodes.h
浏览文件 @
e1943fd6
...
...
@@ -69,8 +69,6 @@ typedef struct SSlotDescNode {
ENodeType
type
;
int16_t
slotId
;
SDataType
dataType
;
int16_t
srcTupleId
;
int16_t
srcSlotId
;
bool
reserve
;
bool
output
;
}
SSlotDescNode
;
...
...
@@ -115,6 +113,20 @@ typedef struct SProjectPhysiNode {
SNodeList
*
pProjections
;
}
SProjectPhysiNode
;
typedef
struct
SJoinPhysiNode
{
SPhysiNode
node
;
EJoinType
joinType
;
SNode
*
pOnConditions
;
// in or out tuple ?
SNodeList
*
pTargets
;
}
SJoinPhysiNode
;
typedef
struct
SAggPhysiNode
{
SPhysiNode
node
;
SNodeList
*
pExprs
;
// these are expression list of group_by_clause and parameter expression of aggregate function
SNodeList
*
pGroupKeys
;
// SColumnRefNode list
SNodeList
*
pAggFuncs
;
}
SAggPhysiNode
;
#ifdef __cplusplus
}
#endif
...
...
include/libs/nodes/querynodes.h
浏览文件 @
e1943fd6
...
...
@@ -58,15 +58,17 @@ typedef struct SColumnNode {
char
tableAlias
[
TSDB_TABLE_NAME_LEN
];
char
colName
[
TSDB_COL_NAME_LEN
];
SNode
*
pProjectRef
;
}
SColumnNode
;
typedef
struct
SColumnRefNode
{
ENodeType
type
;
SDataType
dataType
;
int16_t
tupleId
;
int16_t
slotId
;
int16_t
columnId
;
}
SColumnRefNode
;
}
SColumnNode
;
// typedef struct SColumnRefNode {
// ENodeType type;
// SDataType dataType;
// int16_t tupleId;
// int16_t slotId;
// int16_t columnId;
// } SColumnRefNode;
typedef
struct
STargetNode
{
ENodeType
type
;
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
e1943fd6
...
...
@@ -142,14 +142,6 @@ static SNode* functionNodeCopy(const SFunctionNode* pSrc, SFunctionNode* pDst) {
return
(
SNode
*
)
pDst
;
}
static
SNode
*
columnRefNodeCopy
(
const
SColumnRefNode
*
pSrc
,
SColumnRefNode
*
pDst
)
{
dataTypeCopy
(
&
pSrc
->
dataType
,
&
pDst
->
dataType
);
COPY_SCALAR_FIELD
(
tupleId
);
COPY_SCALAR_FIELD
(
slotId
);
COPY_SCALAR_FIELD
(
columnId
);
return
(
SNode
*
)
pDst
;
}
static
SNode
*
targetNodeCopy
(
const
STargetNode
*
pSrc
,
STargetNode
*
pDst
)
{
COPY_SCALAR_FIELD
(
tupleId
);
COPY_SCALAR_FIELD
(
slotId
);
...
...
@@ -183,8 +175,6 @@ SNode* nodesCloneNode(const SNode* pNode) {
return
logicConditionNodeCopy
((
const
SLogicConditionNode
*
)
pNode
,
(
SLogicConditionNode
*
)
pDst
);
case
QUERY_NODE_FUNCTION
:
return
functionNodeCopy
((
const
SFunctionNode
*
)
pNode
,
(
SFunctionNode
*
)
pDst
);
case
QUERY_NODE_COLUMN_REF
:
return
columnRefNodeCopy
((
const
SColumnRefNode
*
)
pNode
,
(
SColumnRefNode
*
)
pDst
);
case
QUERY_NODE_TARGET
:
return
targetNodeCopy
((
const
STargetNode
*
)
pNode
,
(
STargetNode
*
)
pDst
);
case
QUERY_NODE_REAL_TABLE
:
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
e1943fd6
...
...
@@ -55,8 +55,6 @@ static char* nodeName(ENodeType type) {
return
"NodeList"
;
case
QUERY_NODE_FILL
:
return
"Fill"
;
case
QUERY_NODE_COLUMN_REF
:
return
"ColumnRef"
;
case
QUERY_NODE_TARGET
:
return
"Target"
;
case
QUERY_NODE_RAW_EXPR
:
...
...
@@ -503,28 +501,6 @@ static int32_t groupingSetNodeToJson(const void* pObj, SJson* pJson) {
return
code
;
}
static
const
char
*
jkColumnRefDataType
=
"DataType"
;
static
const
char
*
jkColumnRefTupleId
=
"TupleId"
;
static
const
char
*
jkColumnRefSlotId
=
"SlotId"
;
static
const
char
*
jkColumnRefColumnId
=
"ColumnId"
;
static
int32_t
columnRefNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SColumnRefNode
*
pNode
=
(
const
SColumnRefNode
*
)
pObj
;
int32_t
code
=
tjsonAddObject
(
pJson
,
jkColumnRefDataType
,
dataTypeToJson
,
&
pNode
->
dataType
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkColumnRefTupleId
,
pNode
->
tupleId
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkColumnRefSlotId
,
pNode
->
slotId
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkColumnRefColumnId
,
pNode
->
columnId
);
}
return
code
;
}
static
const
char
*
jkTargetTupleId
=
"TupleId"
;
static
const
char
*
jkTargetSlotId
=
"SlotId"
;
static
const
char
*
jkTargetExpr
=
"Expr"
;
...
...
@@ -646,8 +622,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
case
QUERY_NODE_INTERVAL_WINDOW
:
case
QUERY_NODE_NODE_LIST
:
case
QUERY_NODE_FILL
:
case
QUERY_NODE_COLUMN_REF
:
return
columnRefNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_TARGET
:
return
targetNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_RAW_EXPR
:
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
e1943fd6
...
...
@@ -63,8 +63,6 @@ SNode* nodesMakeNode(ENodeType type) {
return
makeNode
(
type
,
sizeof
(
SNodeListNode
));
case
QUERY_NODE_FILL
:
return
makeNode
(
type
,
sizeof
(
SFillNode
));
case
QUERY_NODE_COLUMN_REF
:
return
makeNode
(
type
,
sizeof
(
SColumnRefNode
));
case
QUERY_NODE_RAW_EXPR
:
return
makeNode
(
type
,
sizeof
(
SRawExprNode
));
case
QUERY_NODE_SET_OPERATOR
:
...
...
@@ -93,6 +91,10 @@ SNode* nodesMakeNode(ENodeType type) {
return
makeNode
(
type
,
sizeof
(
STableScanPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:
return
makeNode
(
type
,
sizeof
(
SProjectPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_JOIN
:
return
makeNode
(
type
,
sizeof
(
SJoinPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_AGG
:
return
makeNode
(
type
,
sizeof
(
SAggPhysiNode
));
default:
break
;
}
...
...
source/libs/planner/src/plannerImpl.c
浏览文件 @
e1943fd6
此差异已折叠。
点击以展开。
source/libs/planner/test/newPlannerTest.cpp
浏览文件 @
e1943fd6
...
...
@@ -123,8 +123,8 @@ TEST_F(NewPlannerTest, simple) {
TEST_F
(
NewPlannerTest
,
groupBy
)
{
setDatabase
(
"root"
,
"test"
);
bind
(
"SELECT count(*) FROM t1"
);
ASSERT_TRUE
(
run
());
//
bind("SELECT count(*) FROM t1");
//
ASSERT_TRUE(run());
bind
(
"SELECT c1, count(*) FROM t1 GROUP BY c1"
);
ASSERT_TRUE
(
run
());
...
...
source/libs/scalar/inc/filterInt.h
浏览文件 @
e1943fd6
...
...
@@ -301,11 +301,11 @@ typedef struct SFilterInfo {
#define FILTER_GET_FIELD(i, id) (&((i)->fields[(id).type].fields[(id).idx]))
#define FILTER_GET_COL_FIELD(i, idx) (&((i)->fields[FLD_TYPE_COLUMN].fields[idx]))
#define FILTER_GET_COL_FIELD_TYPE(fi) (((SColumn
RefNode *)((fi)->desc))->data
Type.type)
#define FILTER_GET_COL_FIELD_SIZE(fi) (((SColumn
RefNode *)((fi)->desc))->data
Type.bytes)
#define FILTER_GET_COL_FIELD_ID(fi) (((SColumn
RefNode *)((fi)->desc))->column
Id)
#define FILTER_GET_COL_FIELD_SLOT_ID(fi) (((SColumn
Ref
Node *)((fi)->desc))->slotId)
#define FILTER_GET_COL_FIELD_DESC(fi) ((SColumn
Ref
Node *)((fi)->desc))
#define FILTER_GET_COL_FIELD_TYPE(fi) (((SColumn
Node *)((fi)->desc))->node.res
Type.type)
#define FILTER_GET_COL_FIELD_SIZE(fi) (((SColumn
Node *)((fi)->desc))->node.res
Type.bytes)
#define FILTER_GET_COL_FIELD_ID(fi) (((SColumn
Node *)((fi)->desc))->col
Id)
#define FILTER_GET_COL_FIELD_SLOT_ID(fi) (((SColumnNode *)((fi)->desc))->slotId)
#define FILTER_GET_COL_FIELD_DESC(fi) ((SColumnNode *)((fi)->desc))
#define FILTER_GET_COL_FIELD_DATA(fi, ri) (colDataGet(((SColumnInfoData *)(fi)->data), (ri)))
#define FILTER_GET_VAL_FIELD_TYPE(fi) (((SValueNode *)((fi)->desc))->node.resType.type)
#define FILTER_GET_VAL_FIELD_DATA(fi) ((char *)(fi)->data)
...
...
source/libs/scalar/src/filter.c
浏览文件 @
e1943fd6
...
...
@@ -914,14 +914,14 @@ int32_t filterAddFieldFromNode(SFilterInfo *info, SNode *node, SFilterFieldId *f
FLT_ERR_RET
(
TSDB_CODE_QRY_APP_ERROR
);
}
if
(
nodeType
(
node
)
!=
QUERY_NODE_COLUMN
_REF
&&
nodeType
(
node
)
!=
QUERY_NODE_VALUE
&&
nodeType
(
node
)
!=
QUERY_NODE_NODE_LIST
)
{
if
(
nodeType
(
node
)
!=
QUERY_NODE_COLUMN
&&
nodeType
(
node
)
!=
QUERY_NODE_VALUE
&&
nodeType
(
node
)
!=
QUERY_NODE_NODE_LIST
)
{
FLT_ERR_RET
(
TSDB_CODE_QRY_APP_ERROR
);
}
int32_t
type
;
void
*
v
;
if
(
nodeType
(
node
)
==
QUERY_NODE_COLUMN
_REF
)
{
if
(
nodeType
(
node
)
==
QUERY_NODE_COLUMN
)
{
type
=
FLD_TYPE_COLUMN
;
v
=
node
;
}
else
{
...
...
@@ -1454,7 +1454,7 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options)
qDebug
(
"COLUMN Field Num:%u"
,
info
->
fields
[
FLD_TYPE_COLUMN
].
num
);
for
(
uint32_t
i
=
0
;
i
<
info
->
fields
[
FLD_TYPE_COLUMN
].
num
;
++
i
)
{
SFilterField
*
field
=
&
info
->
fields
[
FLD_TYPE_COLUMN
].
fields
[
i
];
SColumn
RefNode
*
refNode
=
(
SColumnRef
Node
*
)
field
->
desc
;
SColumn
Node
*
refNode
=
(
SColumn
Node
*
)
field
->
desc
;
qDebug
(
"COL%d => [%d][%d]"
,
i
,
refNode
->
tupleId
,
refNode
->
slotId
);
}
...
...
@@ -1483,7 +1483,7 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options)
char
str
[
512
]
=
{
0
};
SFilterField
*
left
=
FILTER_UNIT_LEFT_FIELD
(
info
,
unit
);
SColumn
RefNode
*
refNode
=
(
SColumnRef
Node
*
)
left
->
desc
;
SColumn
Node
*
refNode
=
(
SColumn
Node
*
)
left
->
desc
;
if
(
unit
->
compare
.
optr
>=
0
&&
unit
->
compare
.
optr
<=
OP_TYPE_JSON_CONTAINS
){
len
=
sprintf
(
str
,
"UNIT[%d] => [%d][%d] %s ["
,
i
,
refNode
->
tupleId
,
refNode
->
slotId
,
gOptrStr
[
unit
->
compare
.
optr
].
str
);
}
...
...
@@ -3487,7 +3487,7 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
return
DEAL_RES_CONTINUE
;
}
if
(
QUERY_NODE_VALUE
==
nodeType
(
*
pNode
)
||
QUERY_NODE_NODE_LIST
==
nodeType
(
*
pNode
)
||
QUERY_NODE_COLUMN
_REF
==
nodeType
(
*
pNode
))
{
if
(
QUERY_NODE_VALUE
==
nodeType
(
*
pNode
)
||
QUERY_NODE_NODE_LIST
==
nodeType
(
*
pNode
)
||
QUERY_NODE_COLUMN
==
nodeType
(
*
pNode
))
{
return
DEAL_RES_CONTINUE
;
}
...
...
@@ -3510,7 +3510,7 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
return
DEAL_RES_ERROR
;
}
if
(
QUERY_NODE_COLUMN
_REF
!=
nodeType
(
node
->
pLeft
))
{
if
(
QUERY_NODE_COLUMN
!=
nodeType
(
node
->
pLeft
))
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
...
...
@@ -3521,12 +3521,12 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
return
DEAL_RES_CONTINUE
;
}
}
else
{
if
((
QUERY_NODE_COLUMN
_REF
!=
nodeType
(
node
->
pLeft
))
&&
(
QUERY_NODE_VALUE
!=
nodeType
(
node
->
pLeft
)))
{
if
((
QUERY_NODE_COLUMN
!=
nodeType
(
node
->
pLeft
))
&&
(
QUERY_NODE_VALUE
!=
nodeType
(
node
->
pLeft
)))
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
if
((
QUERY_NODE_COLUMN
_REF
!=
nodeType
(
node
->
pRight
))
&&
(
QUERY_NODE_VALUE
!=
nodeType
(
node
->
pRight
)))
{
if
((
QUERY_NODE_COLUMN
!=
nodeType
(
node
->
pRight
))
&&
(
QUERY_NODE_VALUE
!=
nodeType
(
node
->
pRight
)))
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
...
...
@@ -3536,7 +3536,7 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
return
DEAL_RES_CONTINUE
;
}
if
(
QUERY_NODE_COLUMN
_REF
!=
nodeType
(
node
->
pLeft
))
{
if
(
QUERY_NODE_COLUMN
!=
nodeType
(
node
->
pLeft
))
{
SNode
*
t
=
node
->
pLeft
;
node
->
pLeft
=
node
->
pRight
;
node
->
pRight
=
t
;
...
...
@@ -3549,10 +3549,10 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
}
if
(
OP_TYPE_IN
!=
node
->
opType
)
{
SColumn
RefNode
*
refNode
=
(
SColumnRef
Node
*
)
node
->
pLeft
;
SColumn
Node
*
refNode
=
(
SColumn
Node
*
)
node
->
pLeft
;
SValueNode
*
valueNode
=
(
SValueNode
*
)
node
->
pRight
;
int32_t
type
=
vectorGetConvertType
(
refNode
->
data
Type
.
type
,
valueNode
->
node
.
resType
.
type
);
if
(
0
!=
type
&&
type
!=
refNode
->
data
Type
.
type
)
{
int32_t
type
=
vectorGetConvertType
(
refNode
->
node
.
res
Type
.
type
,
valueNode
->
node
.
resType
.
type
);
if
(
0
!=
type
&&
type
!=
refNode
->
node
.
res
Type
.
type
)
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
...
...
source/libs/scalar/src/scalar.c
浏览文件 @
e1943fd6
...
...
@@ -134,13 +134,13 @@ int32_t sclInitParam(SNode* node, SScalarParam *param, SScalarCtx *ctx, int32_t
break
;
}
case
QUERY_NODE_COLUMN
_REF
:
{
case
QUERY_NODE_COLUMN
:
{
if
(
NULL
==
ctx
)
{
sclError
(
"invalid node type for constant calculating, type:%d, ctx:%p"
,
nodeType
(
node
),
ctx
);
SCL_ERR_RET
(
TSDB_CODE_QRY_APP_ERROR
);
}
SColumn
RefNode
*
ref
=
(
SColumnRef
Node
*
)
node
;
SColumn
Node
*
ref
=
(
SColumn
Node
*
)
node
;
if
(
ref
->
slotId
>=
taosArrayGetSize
(
ctx
->
pSrc
->
pDataBlock
))
{
sclError
(
"column ref slotId is too big, slodId:%d, dataBlockSize:%d"
,
ref
->
slotId
,
(
int32_t
)
taosArrayGetSize
(
ctx
->
pSrc
->
pDataBlock
));
SCL_ERR_RET
(
TSDB_CODE_QRY_INVALID_INPUT
);
...
...
@@ -281,7 +281,8 @@ int32_t sclExecFuncion(SFunctionNode *node, SScalarCtx *ctx, SScalarParam *outpu
SScalarFuncExecFuncs
ffpSet
=
{
0
};
int32_t
code
=
fmGetScalarFuncExecFuncs
(
node
->
funcId
,
&
ffpSet
);
if
(
code
)
{
sclError
(
"fmGetFuncExecFuncs failed, funcId:%d, code:%s"
,
node
->
funcId
,
tstrerror
(
code
));
sclError
(
"fmGetFuncExecFuncs failed, funcId:%d, code:%s"
,
node
->
funcId
,
tstrerror
(
code
));
SCL_ERR_RET
(
code
);
}
...
...
@@ -299,7 +300,8 @@ int32_t sclExecFuncion(SFunctionNode *node, SScalarCtx *ctx, SScalarParam *outpu
for
(
int32_t
i
=
0
;
i
<
rowNum
;
++
i
)
{
code
=
(
*
ffpSet
.
process
)(
params
,
node
->
pParameterList
->
length
,
output
);
if
(
code
)
{
sclError
(
"scalar function exec failed, funcId:%d, code:%s"
,
node
->
funcId
,
tstrerror
(
code
));
sclError
(
"scalar function exec failed, funcId:%d, code:%s"
,
node
->
funcId
,
tstrerror
(
code
));
SCL_ERR_JRET
(
code
);
}
...
...
@@ -599,7 +601,7 @@ EDealRes sclWalkOperator(SNode* pNode, void* pContext) {
EDealRes
sclCalcWalker
(
SNode
*
pNode
,
void
*
pContext
)
{
if
(
QUERY_NODE_VALUE
==
nodeType
(
pNode
)
||
QUERY_NODE_NODE_LIST
==
nodeType
(
pNode
)
||
QUERY_NODE_COLUMN
_REF
==
nodeType
(
pNode
))
{
if
(
QUERY_NODE_VALUE
==
nodeType
(
pNode
)
||
QUERY_NODE_NODE_LIST
==
nodeType
(
pNode
)
||
QUERY_NODE_COLUMN
==
nodeType
(
pNode
))
{
return
DEAL_RES_CONTINUE
;
}
...
...
source/libs/scalar/test/filter/filterTests.cpp
浏览文件 @
e1943fd6
...
...
@@ -76,15 +76,15 @@ void flttMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
}
void
flttMakeColRefNode
(
SNode
**
pNode
,
SSDataBlock
**
block
,
int32_t
dataType
,
int32_t
dataBytes
,
int32_t
rowNum
,
void
*
value
)
{
SNode
*
node
=
nodesMakeNode
(
QUERY_NODE_COLUMN
_REF
);
SColumn
RefNode
*
rnode
=
(
SColumnRef
Node
*
)
node
;
rnode
->
data
Type
.
type
=
dataType
;
rnode
->
data
Type
.
bytes
=
dataBytes
;
SNode
*
node
=
nodesMakeNode
(
QUERY_NODE_COLUMN
);
SColumn
Node
*
rnode
=
(
SColumn
Node
*
)
node
;
rnode
->
node
.
res
Type
.
type
=
dataType
;
rnode
->
node
.
res
Type
.
bytes
=
dataBytes
;
rnode
->
tupleId
=
0
;
if
(
NULL
==
block
)
{
rnode
->
slotId
=
2
;
rnode
->
col
umn
Id
=
55
;
rnode
->
colId
=
55
;
*
pNode
=
(
SNode
*
)
rnode
;
return
;
...
...
@@ -120,7 +120,7 @@ void flttMakeColRefNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
taosArrayPush
(
res
->
pDataBlock
,
&
idata
);
rnode
->
slotId
=
2
;
rnode
->
col
umn
Id
=
55
;
rnode
->
colId
=
55
;
*
block
=
res
;
}
else
{
...
...
@@ -137,7 +137,7 @@ void flttMakeColRefNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
res
->
info
.
numOfCols
++
;
rnode
->
slotId
=
idx
;
rnode
->
col
umn
Id
=
55
+
idx
;
rnode
->
colId
=
55
+
idx
;
}
*
pNode
=
(
SNode
*
)
rnode
;
...
...
@@ -259,7 +259,7 @@ TEST(columnTest, smallint_column_greater_double_value) {
ASSERT_EQ
(
code
,
0
);
SColumnDataAgg
stat
=
{
0
};
stat
.
colId
=
((
SColumn
RefNode
*
)
pLeft
)
->
column
Id
;
stat
.
colId
=
((
SColumn
Node
*
)
pLeft
)
->
col
Id
;
stat
.
max
=
10
;
stat
.
min
=
5
;
stat
.
numOfNull
=
0
;
...
...
@@ -310,7 +310,7 @@ TEST(columnTest, int_column_greater_smallint_value) {
ASSERT_EQ
(
code
,
0
);
SColumnDataAgg
stat
=
{
0
};
stat
.
colId
=
((
SColumn
RefNode
*
)
pLeft
)
->
column
Id
;
stat
.
colId
=
((
SColumn
Node
*
)
pLeft
)
->
col
Id
;
stat
.
max
=
10
;
stat
.
min
=
5
;
stat
.
numOfNull
=
0
;
...
...
source/libs/scalar/test/scalar/scalarTests.cpp
浏览文件 @
e1943fd6
...
...
@@ -75,10 +75,10 @@ void scltMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
}
void
scltMakeColRefNode
(
SNode
**
pNode
,
SSDataBlock
**
block
,
int32_t
dataType
,
int32_t
dataBytes
,
int32_t
rowNum
,
void
*
value
)
{
SNode
*
node
=
nodesMakeNode
(
QUERY_NODE_COLUMN
_REF
);
SColumn
RefNode
*
rnode
=
(
SColumnRef
Node
*
)
node
;
rnode
->
data
Type
.
type
=
dataType
;
rnode
->
data
Type
.
bytes
=
dataBytes
;
SNode
*
node
=
nodesMakeNode
(
QUERY_NODE_COLUMN
);
SColumn
Node
*
rnode
=
(
SColumn
Node
*
)
node
;
rnode
->
node
.
res
Type
.
type
=
dataType
;
rnode
->
node
.
res
Type
.
bytes
=
dataBytes
;
rnode
->
tupleId
=
0
;
if
(
NULL
==
*
block
)
{
...
...
@@ -111,7 +111,7 @@ void scltMakeColRefNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
taosArrayPush
(
res
->
pDataBlock
,
&
idata
);
rnode
->
slotId
=
2
;
rnode
->
col
umn
Id
=
55
;
rnode
->
colId
=
55
;
*
block
=
res
;
}
else
{
...
...
@@ -126,7 +126,7 @@ void scltMakeColRefNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
taosArrayPush
(
res
->
pDataBlock
,
&
idata
);
rnode
->
slotId
=
idx
;
rnode
->
col
umn
Id
=
55
+
idx
;
rnode
->
colId
=
55
+
idx
;
}
*
pNode
=
(
SNode
*
)
rnode
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录