Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
751cad9c
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看板
提交
751cad9c
编写于
4月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-14393] fix bug.
上级
803e1ab1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
39 deletion
+36
-39
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+34
-17
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+0
-1
source/libs/scalar/test/filter/filterTests.cpp
source/libs/scalar/test/filter/filterTests.cpp
+0
-20
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
751cad9c
...
...
@@ -393,6 +393,7 @@ typedef struct STableScanInfo {
int32_t
times
;
// repeat counts
int32_t
current
;
int32_t
reverseTimes
;
// 0 by default
SNode
*
pFilterNode
;
// filter operator info
SqlFunctionCtx
*
pCtx
;
// next operator query context
SResultRowInfo
*
pResultRowInfo
;
int32_t
*
rowCellInfoOffset
;
...
...
@@ -628,7 +629,7 @@ typedef struct SDistinctOperatorInfo {
SOperatorInfo
*
createExchangeOperatorInfo
(
const
SNodeList
*
pSources
,
SSDataBlock
*
pBlock
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createTableScanOperatorInfo
(
void
*
pTsdbReadHandle
,
int32_t
order
,
int32_t
numOfCols
,
int32_t
repeatTime
,
int32_t
reverseTime
,
SArray
*
pColMatchInfo
,
SExecTaskInfo
*
pTaskInfo
);
int32_t
reverseTime
,
SArray
*
pColMatchInfo
,
S
Node
*
pCondition
,
S
ExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createAggregateOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResultBlock
,
SExecTaskInfo
*
pTaskInfo
,
const
STableGroupInfo
*
pTableGroupInfo
);
SOperatorInfo
*
createMultiTableAggOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SExecTaskInfo
*
pTaskInfo
,
const
STableGroupInfo
*
pTableGroupInfo
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
751cad9c
...
...
@@ -3016,6 +3016,23 @@ int32_t loadDataBlock(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableScanInfo,
taosArraySet
(
pBlock
->
pDataBlock
,
pColMatchInfo
->
targetSlotId
,
p
);
}
if
(
pTableScanInfo
->
pFilterNode
!=
NULL
)
{
SFilterInfo
*
filter
=
NULL
;
int32_t
code
=
filterInitFromNode
((
SNode
*
)
pTableScanInfo
->
pFilterNode
,
&
filter
,
0
);
SFilterColumnParam
param1
=
{.
numOfCols
=
pBlock
->
info
.
numOfCols
,
.
pDataBlock
=
pBlock
->
pDataBlock
};
code
=
filterSetDataFromSlotId
(
filter
,
&
param1
);
int8_t
*
rowRes
=
NULL
;
bool
keep
=
filterExecute
(
filter
,
pBlock
,
&
rowRes
,
NULL
,
param1
.
numOfCols
);
// filterSetColFieldData(pQueryAttr->pFilters, pBlock->info.numOfCols, pBlock->pDataBlock);
// if (pQueryAttr->pFilters != NULL) {
// filterColRowsInDataBlock(pRuntimeEnv, pBlock, ascQuery);
// }
}
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -4655,7 +4672,6 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator, bool* newgroup) {
// break;
// }
//
// pRuntimeEnv->current = *pTableQueryInfo;
// doTableQueryInfoTimeWindowCheck(pTaskInfo, *pTableQueryInfo, pTableScanInfo->order);
// }
...
...
@@ -5413,7 +5429,7 @@ SSDataBlock* createResultDataBlock(const SArray* pExprInfo) {
SOperatorInfo
*
createTableScanOperatorInfo
(
void
*
pTsdbReadHandle
,
int32_t
order
,
int32_t
numOfOutput
,
int32_t
repeatTime
,
int32_t
reverseTime
,
SArray
*
pColMatchInfo
,
SExecTaskInfo
*
pTaskInfo
)
{
S
Node
*
pCondition
,
S
ExecTaskInfo
*
pTaskInfo
)
{
assert
(
repeatTime
>
0
);
STableScanInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STableScanInfo
));
...
...
@@ -5432,21 +5448,22 @@ SOperatorInfo* createTableScanOperatorInfo(void* pTsdbReadHandle, int32_t order,
taosArrayPush
(
pInfo
->
block
.
pDataBlock
,
&
idata
);
}
pInfo
->
pTsdbReadHandle
=
pTsdbReadHandle
;
pInfo
->
times
=
repeatTime
;
pInfo
->
reverseTimes
=
reverseTime
;
pInfo
->
order
=
order
;
pInfo
->
current
=
0
;
pInfo
->
scanFlag
=
MAIN_SCAN
;
pInfo
->
pColMatchInfo
=
pColMatchInfo
;
pOperator
->
name
=
"TableScanOperator"
;
pInfo
->
pFilterNode
=
pCondition
;
pInfo
->
pTsdbReadHandle
=
pTsdbReadHandle
;
pInfo
->
times
=
repeatTime
;
pInfo
->
reverseTimes
=
reverseTime
;
pInfo
->
order
=
order
;
pInfo
->
current
=
0
;
pInfo
->
scanFlag
=
MAIN_SCAN
;
pInfo
->
pColMatchInfo
=
pColMatchInfo
;
pOperator
->
name
=
"TableScanOperator"
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
;
pOperator
->
blockingOptr
=
false
;
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
info
=
pInfo
;
pOperator
->
numOfOutput
=
numOfOutput
;
pOperator
->
getNextFn
=
doTableScan
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
info
=
pInfo
;
pOperator
->
numOfOutput
=
numOfOutput
;
pOperator
->
getNextFn
=
doTableScan
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
return
pOperator
;
}
...
...
@@ -5703,7 +5720,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pInfo
->
pRes
->
pDataBlock
,
i
);
int64_t
tmp
=
0
;
char
t
[
10
]
=
{
0
};
STR_TO_VARSTR
(
t
,
"_"
);
STR_TO_VARSTR
(
t
,
"_"
);
//TODO
if
(
IS_VAR_DATA_TYPE
(
pColInfoData
->
info
.
type
))
{
colDataAppend
(
pColInfoData
,
numOfRows
,
t
,
false
);
}
else
{
...
...
@@ -8618,7 +8635,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
SArray
*
pColList
=
extractColMatchInfo
(
pScanPhyNode
->
pScanCols
,
pScanPhyNode
->
node
.
pOutputDataBlockDesc
,
&
numOfCols
);
return
createTableScanOperatorInfo
(
pDataReader
,
pScanPhyNode
->
order
,
numOfCols
,
pScanPhyNode
->
count
,
pScanPhyNode
->
reverse
,
pColList
,
pTaskInfo
);
pScanPhyNode
->
reverse
,
pColList
,
p
ScanPhyNode
->
node
.
pConditions
,
p
TaskInfo
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
==
nodeType
(
pPhyNode
))
{
SExchangePhysiNode
*
pExchange
=
(
SExchangePhysiNode
*
)
pPhyNode
;
SSDataBlock
*
pResBlock
=
createOutputBuf_rv1
(
pExchange
->
node
.
pOutputDataBlockDesc
);
...
...
source/libs/scalar/src/filter.c
浏览文件 @
751cad9c
...
...
@@ -3668,7 +3668,6 @@ bool filterExecute(SFilterInfo *info, SSDataBlock *pSrc, int8_t** p, SColumnData
taosArrayPush
(
pList
,
&
pSrc
);
FLT_ERR_RET
(
scalarCalculate
(
info
->
sclCtx
.
node
,
pList
,
&
output
));
taosArrayDestroy
(
pList
);
// TODO Fix it
// *p = output.orig.data;
...
...
source/libs/scalar/test/filter/filterTests.cpp
浏览文件 @
751cad9c
...
...
@@ -275,7 +275,6 @@ TEST(timerangeTest, greater_and_lower) {
nodesDestroyNode
(
logicNode
);
}
TEST
(
columnTest
,
smallint_column_greater_double_value
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
int16_t
leftv
[
5
]
=
{
1
,
2
,
3
,
4
,
5
};
...
...
@@ -386,7 +385,6 @@ TEST(columnTest, int_column_greater_smallint_value) {
blockDataDestroy
(
src
);
}
TEST
(
columnTest
,
int_column_in_double_list
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
listNode
=
NULL
,
*
opNode
=
NULL
;
int32_t
leftv
[
5
]
=
{
1
,
2
,
3
,
4
,
5
};
...
...
@@ -432,8 +430,6 @@ TEST(columnTest, int_column_in_double_list) {
blockDataDestroy
(
src
);
}
TEST
(
columnTest
,
binary_column_in_binary_list
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
listNode
=
NULL
,
*
opNode
=
NULL
;
bool
eRes
[
5
]
=
{
true
,
true
,
false
,
false
,
false
};
...
...
@@ -497,7 +493,6 @@ TEST(columnTest, binary_column_in_binary_list) {
blockDataDestroy
(
src
);
}
TEST
(
columnTest
,
binary_column_like_binary
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
char
rightv
[
64
]
=
{
0
};
...
...
@@ -546,7 +541,6 @@ TEST(columnTest, binary_column_like_binary) {
blockDataDestroy
(
src
);
}
TEST
(
columnTest
,
binary_column_is_null
)
{
SNode
*
pLeft
=
NULL
,
*
opNode
=
NULL
;
char
leftv
[
5
][
5
]
=
{
0
};
...
...
@@ -641,8 +635,6 @@ TEST(columnTest, binary_column_is_not_null) {
blockDataDestroy
(
src
);
}
TEST
(
opTest
,
smallint_column_greater_int_column
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
int16_t
leftv
[
5
]
=
{
1
,
-
6
,
-
2
,
11
,
101
};
...
...
@@ -680,7 +672,6 @@ TEST(opTest, smallint_column_greater_int_column) {
blockDataDestroy
(
src
);
}
TEST
(
opTest
,
smallint_value_add_int_column
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
int32_t
leftv
=
1
;
...
...
@@ -719,8 +710,6 @@ TEST(opTest, smallint_value_add_int_column) {
blockDataDestroy
(
src
);
}
TEST
(
opTest
,
bigint_column_multi_binary_column
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
int64_t
leftv
[
5
]
=
{
1
,
2
,
3
,
4
,
5
};
...
...
@@ -845,8 +834,6 @@ TEST(opTest, smallint_column_or_float_column) {
blockDataDestroy
(
src
);
}
TEST
(
opTest
,
smallint_column_or_double_value
)
{
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
opNode
=
NULL
;
int16_t
leftv
[
5
]
=
{
0
,
2
,
3
,
0
,
-
1
};
...
...
@@ -885,7 +872,6 @@ TEST(opTest, smallint_column_or_double_value) {
blockDataDestroy
(
src
);
}
TEST
(
opTest
,
binary_column_is_true
)
{
SNode
*
pLeft
=
NULL
,
*
opNode
=
NULL
;
char
leftv
[
5
][
5
]
=
{
0
};
...
...
@@ -930,7 +916,6 @@ TEST(opTest, binary_column_is_true) {
blockDataDestroy
(
src
);
}
TEST
(
filterModelogicTest
,
diff_columns_and_or_and
)
{
flttInitLogFile
();
...
...
@@ -1071,7 +1056,6 @@ TEST(filterModelogicTest, same_column_and_or_and) {
blockDataDestroy
(
src
);
}
TEST
(
filterModelogicTest
,
diff_columns_or_and_or
)
{
SNode
*
pLeft1
=
NULL
,
*
pRight1
=
NULL
,
*
pLeft2
=
NULL
,
*
pRight2
=
NULL
,
*
opNode1
=
NULL
,
*
opNode2
=
NULL
;
SNode
*
logicNode1
=
NULL
,
*
logicNode2
=
NULL
;
...
...
@@ -1210,8 +1194,6 @@ TEST(filterModelogicTest, same_column_or_and_or) {
blockDataDestroy
(
src
);
}
TEST
(
scalarModelogicTest
,
diff_columns_or_and_or
)
{
flttInitLogFile
();
...
...
@@ -1283,8 +1265,6 @@ TEST(scalarModelogicTest, diff_columns_or_and_or) {
blockDataDestroy
(
src
);
}
int
main
(
int
argc
,
char
**
argv
)
{
taosSeedRand
(
taosGetTimestampSec
());
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录