Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
40987fa5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
40987fa5
编写于
2月 09, 2023
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:do not check whether the expired data has been update
上级
0c9b2c03
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
41 deletion
+16
-41
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+7
-36
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+7
-0
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+0
-5
tests/script/tsim/stream/ignoreExpiredData.sim
tests/script/tsim/stream/ignoreExpiredData.sim
+2
-0
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
40987fa5
...
...
@@ -1435,7 +1435,12 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock
dumyInfo
.
cur
.
pageId
=
-
1
;
bool
isClosed
=
false
;
STimeWindow
win
=
{.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
if
(
tableInserted
&&
isOverdue
(
tsCol
[
rowId
],
&
pInfo
->
twAggSup
))
{
bool
overDue
=
isOverdue
(
tsCol
[
rowId
],
&
pInfo
->
twAggSup
);
if
(
pInfo
->
igExpired
&&
overDue
)
{
continue
;
}
if
(
tableInserted
&&
overDue
)
{
win
=
getActiveTimeWindow
(
NULL
,
&
dumyInfo
,
tsCol
[
rowId
],
&
pInfo
->
interval
,
TSDB_ORDER_ASC
);
isClosed
=
isCloseWindow
(
&
win
,
&
pInfo
->
twAggSup
);
}
...
...
@@ -1701,41 +1706,6 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
SStreamScanInfo
*
pInfo
=
pOperator
->
info
;
qDebug
(
"stream scan called"
);
#if 0
SStreamState* pState = pTaskInfo->streamInfo.pState;
if (pState) {
printf(">>>>>>>> stream write backend\n");
SWinKey key = {
.ts = 1,
.groupId = 2,
};
char tmp[100] = "abcdefg1";
if (streamStatePut(pState, &key, &tmp, strlen(tmp) + 1) < 0) {
ASSERT(0);
}
key.ts = 2;
char tmp2[100] = "abcdefg2";
if (streamStatePut(pState, &key, &tmp2, strlen(tmp2) + 1) < 0) {
ASSERT(0);
}
key.groupId = 5;
key.ts = 1;
char tmp3[100] = "abcdefg3";
if (streamStatePut(pState, &key, &tmp3, strlen(tmp3) + 1) < 0) {
ASSERT(0);
}
char* val2 = NULL;
int32_t sz;
if (streamStateGet(pState, &key, (void**)&val2, &sz) < 0) {
ASSERT(0);
}
printf("stream read %s %d\n", val2, sz);
streamFreeVal(val2);
}
#endif
if
(
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__PREPARE1
||
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__PREPARE2
)
{
...
...
@@ -2370,6 +2340,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
pInfo
->
partitionSup
.
needCalc
=
false
;
pInfo
->
igCheckUpdate
=
pTableScanNode
->
igCheckUpdate
;
pInfo
->
igExpired
=
pTableScanNode
->
igExpired
;
pInfo
->
twAggSup
.
maxTs
=
INT64_MIN
;
setOperatorInfo
(
pOperator
,
"StreamScanOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
40987fa5
...
...
@@ -343,6 +343,13 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
pScan
->
node
.
groupAction
=
GROUP_ACTION_NONE
;
pScan
->
node
.
resultDataOrder
=
DATA_ORDER_LEVEL_IN_BLOCK
;
if
(
pCxt
->
pPlanCxt
->
streamQuery
)
{
pScan
->
triggerType
=
pCxt
->
pPlanCxt
->
triggerType
;
pScan
->
watermark
=
pCxt
->
pPlanCxt
->
watermark
;
pScan
->
deleteMark
=
pCxt
->
pPlanCxt
->
deleteMark
;
pScan
->
igExpired
=
pCxt
->
pPlanCxt
->
igExpired
;
pScan
->
igCheckUpdate
=
pCxt
->
pPlanCxt
->
igCheckUpdate
;
}
// set columns to scan
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
40987fa5
...
...
@@ -328,11 +328,6 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) {
pScan
->
sliding
=
((
SWindowLogicNode
*
)
pParent
)
->
sliding
;
pScan
->
intervalUnit
=
((
SWindowLogicNode
*
)
pParent
)
->
intervalUnit
;
pScan
->
slidingUnit
=
((
SWindowLogicNode
*
)
pParent
)
->
slidingUnit
;
pScan
->
triggerType
=
((
SWindowLogicNode
*
)
pParent
)
->
triggerType
;
pScan
->
watermark
=
((
SWindowLogicNode
*
)
pParent
)
->
watermark
;
pScan
->
deleteMark
=
((
SWindowLogicNode
*
)
pParent
)
->
deleteMark
;
pScan
->
igExpired
=
((
SWindowLogicNode
*
)
pParent
)
->
igExpired
;
pScan
->
igCheckUpdate
=
((
SWindowLogicNode
*
)
pParent
)
->
igCheckUpdate
;
}
}
...
...
tests/script/tsim/stream/ignoreExpiredData.sim
浏览文件 @
40987fa5
...
...
@@ -52,6 +52,7 @@ sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,1,2,3,1.1);
sql insert into t1 values(1648791233002,2,2,3,2.1);
sql insert into t1 values(1648791243003,2,2,3,3.1);
sleep 300
sql insert into t1 values(1648791200000,4,2,3,4.1);
$loop_count = 0
...
...
@@ -115,6 +116,7 @@ sql create stream stream_t1 trigger at_once IGNORE EXPIRED 1 into streamtST1 as
sql create stream stream_t2 trigger at_once IGNORE EXPIRED 1 into streamtST2 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st session(ts, 10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sql insert into ts1 values(1648791222001,2,2,3);
sleep 300
sql insert into ts2 values(1648791211000,1,2,3);
sql insert into ts2 values(1648791222001,2,2,3);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录