Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
387cfe8d
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看板
提交
387cfe8d
编写于
3月 30, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-13039] fix bug in stream interval query.
上级
8fe7c183
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
43 addition
and
16 deletion
+43
-16
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+1
-1
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+2
-2
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+1
-0
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+34
-12
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+3
-0
source/libs/stream/src/tstream.c
source/libs/stream/src/tstream.c
+1
-0
未找到文件。
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
387cfe8d
...
...
@@ -167,7 +167,7 @@ SArray* tqRetrieveDataBlock(STqReadHandle* pHandle) {
if
(
!
tdSTSRowIterNext
(
&
iter
,
pColData
->
info
.
colId
,
pColData
->
info
.
type
,
&
sVal
))
{
break
;
}
if
(
colDataAppend
(
pColData
,
curRow
,
sVal
.
val
,
sVal
.
valType
==
TD_VTYPE_NULL
)
<
0
)
{
if
(
colDataAppend
(
pColData
,
curRow
,
sVal
.
val
,
false
)
<
0
)
{
taosArrayDestroyEx
(
pArray
,
(
void
(
*
)(
void
*
))
tDeleteSSDataBlock
);
return
NULL
;
}
...
...
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
387cfe8d
...
...
@@ -69,9 +69,9 @@ int vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
return
tqProcessPollReq
(
pVnode
->
pTq
,
pMsg
);
case
TDMT_VND_TASK_PIPE_EXEC
:
case
TDMT_VND_TASK_MERGE_EXEC
:
return
tqProcessTaskExec
(
pVnode
->
pTq
,
msgstr
,
msgLen
,
pInfo
->
workerId
);
return
tqProcessTaskExec
(
pVnode
->
pTq
,
msgstr
,
msgLen
,
0
);
case
TDMT_VND_STREAM_TRIGGER
:
return
tqProcessStreamTrigger
(
pVnode
->
pTq
,
pMsg
->
pCont
,
pMsg
->
contLen
,
pInfo
->
workerId
);
return
tqProcessStreamTrigger
(
pVnode
->
pTq
,
pMsg
->
pCont
,
pMsg
->
contLen
,
0
);
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pVnode
,
pVnode
->
pQuery
,
pMsg
);
default:
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
387cfe8d
...
...
@@ -422,6 +422,7 @@ typedef struct SStreamBlockScanInfo {
uint64_t
numOfRows
;
// total scanned rows
uint64_t
numOfExec
;
// execution times
void
*
readerHandle
;
// stream block reader handle
SArray
*
pColMatchInfo
;
//
}
SStreamBlockScanInfo
;
typedef
struct
SSysTableScanInfo
{
...
...
source/libs/executor/src/executil.c
浏览文件 @
387cfe8d
...
...
@@ -227,7 +227,7 @@ void initMultiResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayL
taosArrayDestroy
(
pGroupResInfo
->
pRows
);
}
pGroupResInfo
->
pRows
=
pArrayList
->
pData
;
pGroupResInfo
->
pRows
=
pArrayList
;
pGroupResInfo
->
index
=
0
;
ASSERT
(
pGroupResInfo
->
index
<=
getNumOfTotalRes
(
pGroupResInfo
));
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
387cfe8d
...
...
@@ -1551,8 +1551,8 @@ static SArray* hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pRe
if
(
pSDataBlock
->
pDataBlock
!=
NULL
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
0
);
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
assert
(
tsCols
[
0
]
==
pSDataBlock
->
info
.
window
.
skey
&&
tsCols
[
pSDataBlock
->
info
.
rows
-
1
]
==
pSDataBlock
->
info
.
window
.
ekey
);
//
assert(tsCols[0] == pSDataBlock->info.window.skey &&
//
tsCols[pSDataBlock->info.rows - 1] == pSDataBlock->info.window.ekey);
}
int32_t
startPos
=
ascScan
?
0
:
(
pSDataBlock
->
info
.
rows
-
1
);
...
...
@@ -3660,6 +3660,7 @@ void finalizeUpdatedResult(SqlFunctionCtx* pCtx, int32_t numOfOutput, SDiskbased
if
(
pCtx
[
j
].
fpSet
.
process
)
{
// TODO set the dummy function.
pCtx
[
j
].
fpSet
.
finalize
(
&
pCtx
[
j
]);
pResInfo
->
initialized
=
true
;
}
if
(
pRow
->
numOfRows
<
pResInfo
->
numOfRes
)
{
...
...
@@ -3778,10 +3779,6 @@ void setResultRowOutputBufInitCtx_rv(SDiskbasedBuf* pBuf, SResultRow* pResult, S
continue
;
}
// int32_t functionId = pCtx[i].functionId;
// if (functionId < 0) {
// continue;
// }
// if (functionId == FUNCTION_TOP || functionId == FUNCTION_BOTTOM || functionId == FUNCTION_DIFF) {
// if (i > 0) pCtx[i].ptsOutputBuf = pCtx[i - 1].pOutput;
// }
...
...
@@ -4971,7 +4968,20 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator, bool* newgroup)
return
NULL
;
}
pInfo
->
pRes
->
pDataBlock
=
tqRetrieveDataBlock
(
pInfo
->
readerHandle
);
SArray
*
pCols
=
tqRetrieveDataBlock
(
pInfo
->
readerHandle
);
int32_t
numOfCols
=
pInfo
->
pRes
->
info
.
numOfCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
p
=
taosArrayGet
(
pCols
,
i
);
SColMatchInfo
*
pColMatchInfo
=
taosArrayGet
(
pInfo
->
pColMatchInfo
,
i
);
if
(
!
pColMatchInfo
->
output
)
{
continue
;
}
ASSERT
(
pColMatchInfo
->
colId
==
p
->
info
.
colId
);
taosArraySet
(
pInfo
->
pRes
->
pDataBlock
,
pColMatchInfo
->
targetSlotId
,
p
);
}
if
(
pInfo
->
pRes
->
pDataBlock
==
NULL
)
{
// TODO add log
pTaskInfo
->
code
=
terrno
;
...
...
@@ -5625,8 +5635,18 @@ SOperatorInfo* createStreamScanOperatorInfo(void* streamReadHandle, SSDataBlock*
return
NULL
;
}
int32_t
numOfOutput
=
taosArrayGetSize
(
pColList
);
SArray
*
pColIds
=
taosArrayInit
(
4
,
sizeof
(
int16_t
));
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
int16_t
*
id
=
taosArrayGet
(
pColList
,
i
);
taosArrayPush
(
pColIds
,
id
);
}
pInfo
->
pColMatchInfo
=
pColList
;
// set the extract column id to streamHandle
tqReadHandleSetColIdList
((
STqReadHandle
*
)
streamReadHandle
,
pCol
List
);
tqReadHandleSetColIdList
((
STqReadHandle
*
)
streamReadHandle
,
pCol
Ids
);
int32_t
code
=
tqReadHandleSetTbUidList
(
streamReadHandle
,
pTableIdList
);
if
(
code
!=
0
)
{
taosMemoryFreeClear
(
pInfo
);
...
...
@@ -6972,7 +6992,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo *pOperator, bool* newgroup
if
(
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pInfo
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
}
return
pInfo
->
binfo
.
pRes
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
}
// STimeWindow win = {0};
...
...
@@ -8801,8 +8821,10 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
SArray
*
tableIdList
=
extractTableIdList
(
pTableGroupInfo
);
SSDataBlock
*
pResBlock
=
createOutputBuf_rv1
(
pScanPhyNode
->
node
.
pOutputDataBlockDesc
);
SArray
*
colList
=
extractScanColumnId
(
pScanPhyNode
->
pScanCols
);
SOperatorInfo
*
pOperator
=
createStreamScanOperatorInfo
(
pHandle
->
reader
,
pResBlock
,
colList
,
tableIdList
,
pTaskInfo
);
int32_t
numOfCols
=
0
;
SArray
*
pColList
=
extractColMatchInfo
(
pScanPhyNode
->
pScanCols
,
pScanPhyNode
->
node
.
pOutputDataBlockDesc
,
&
numOfCols
);
SOperatorInfo
*
pOperator
=
createStreamScanOperatorInfo
(
pHandle
->
reader
,
pResBlock
,
pColList
,
tableIdList
,
pTaskInfo
);
taosArrayDestroy
(
tableIdList
);
return
pOperator
;
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
==
nodeType
(
pPhyNode
))
{
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
387cfe8d
...
...
@@ -719,6 +719,9 @@ static int32_t createStreamScanPhysiNodeByExchange(SPhysiPlanContext* pCxt, SExc
if
(
NULL
==
pScan
->
pScanCols
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
sortScanCols
(
pScan
->
pScanCols
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
addDataBlockSlots
(
pCxt
,
pScan
->
pScanCols
,
pScan
->
node
.
pOutputDataBlockDesc
);
}
...
...
source/libs/stream/src/tstream.c
浏览文件 @
387cfe8d
...
...
@@ -152,6 +152,7 @@ int32_t streamExecTask(SStreamTask* pTask, SMsgCb* pMsgCb, const void* input, in
// sink
if
(
pTask
->
sinkType
==
TASK_SINK__TABLE
)
{
//
blockDebugShowData
(
pRes
);
}
else
if
(
pTask
->
sinkType
==
TASK_SINK__SMA
)
{
pTask
->
smaSink
.
smaHandle
(
pTask
->
ahandle
,
pTask
->
smaSink
.
smaId
,
pRes
);
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录