Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
90e6fb39
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
90e6fb39
编写于
4月 11, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-98] fix bugs in interval query
上级
5fd9705d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
16 deletion
+9
-16
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+9
-16
未找到文件。
src/query/src/queryExecutor.c
浏览文件 @
90e6fb39
...
...
@@ -2566,7 +2566,7 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
tsdb_query_handle_t
pQueryHandle
=
pRuntimeEnv
->
pQueryHandle
;
while
(
tsdbNextDataBlock
(
pQueryHandle
))
{
// check if query is killed or not set the status of query to pass the status check
if
(
isQueryKilled
(
GET_QINFO_ADDR
(
pRuntimeEnv
)))
{
return
0
;
}
...
...
@@ -3865,7 +3865,7 @@ static int32_t doCopyToSData(SQInfo *pQInfo, SWindowResult *result, int32_t orde
int32_t
startIdx
=
0
;
int32_t
step
=
-
1
;
dTrace
(
"QInfo:%p start to copy data from windowResInfo to
pQ
uery buf"
,
GET_QINFO_ADDR
(
pQuery
));
dTrace
(
"QInfo:%p start to copy data from windowResInfo to
q
uery buf"
,
GET_QINFO_ADDR
(
pQuery
));
int32_t
totalSubset
=
getNumOfSubset
(
pQInfo
);
if
(
orderType
==
TSDB_ORDER_ASC
)
{
...
...
@@ -3914,7 +3914,7 @@ static int32_t doCopyToSData(SQInfo *pQInfo, SWindowResult *result, int32_t orde
}
}
dTrace
(
"QInfo:%p copy data to
SQ
uery buf completed"
,
pQInfo
);
dTrace
(
"QInfo:%p copy data to
q
uery buf completed"
,
pQInfo
);
#ifdef _DEBUG_VIEW
displayInterResult
(
pQuery
->
sdata
,
pQuery
,
numOfResult
);
...
...
@@ -4830,7 +4830,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
// vnodePrintQueryStatistics(pSupporter);
}
dTrace
(
"QInfo:%p current:%lld
d, total:%lld
d"
,
pQInfo
,
pQuery
->
rec
.
rows
,
pQuery
->
rec
.
total
);
dTrace
(
"QInfo:%p current:%lld
, total:%ll
d"
,
pQInfo
,
pQuery
->
rec
.
rows
,
pQuery
->
rec
.
total
);
return
;
}
...
...
@@ -4909,8 +4909,6 @@ static void tableFixedOutputProcessor(SQInfo *pQInfo) {
// since the numOfOutputElems must be identical for all sql functions that are allowed to be executed simutanelously.
pQuery
->
rec
.
rows
=
getNumOfResult
(
pRuntimeEnv
);
// assert(pQuery->size <= pQuery->pointsToRead &&
// Q_STATUS_EQUAL(pQuery->over, QUERY_COMPLETED));
// must be top/bottom query if offset > 0
if
(
pQuery
->
limit
.
offset
>
0
)
{
...
...
@@ -4977,7 +4975,7 @@ static void tableIntervalProcessImpl(SQueryRuntimeEnv *pRuntimeEnv) {
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
while
(
1
)
{
initCtxOutputBuf
(
pRuntimeEnv
);
//
initCtxOutputBuf(pRuntimeEnv);
scanAllDataBlocks
(
pRuntimeEnv
);
if
(
isQueryKilled
(
GET_QINFO_ADDR
(
pRuntimeEnv
)))
{
...
...
@@ -5058,13 +5056,7 @@ static void tableIntervalProcessor(SQInfo *pQInfo) {
clearFirstNTimeWindow
(
pRuntimeEnv
,
pQInfo
->
subgroupIdx
);
}
pQuery
->
rec
.
rows
+=
pQuery
->
rec
.
rows
;
pQInfo
->
pointsInterpo
+=
numOfInterpo
;
// dTrace("%p vid:%d sid:%d id:%s, %d points returned %d points interpo, totalRead:%d totalInterpo:%d
// totalReturn:%d",
// pQInfo, pMeterObj->vnode, pMeterObj->sid, pMeterObj->meterId, pQuery->size, numOfInterpo,
// pQInfo->size - pQInfo->pointsInterpo, pQInfo->pointsInterpo, pQInfo->pointsReturned);
}
static
void
tableQueryImpl
(
SQInfo
*
pQInfo
)
{
...
...
@@ -5129,7 +5121,6 @@ static void tableQueryImpl(SQInfo* pQInfo) {
if
(
isIntervalQuery
(
pQuery
)
||
isGroupbyNormalCol
(
pQuery
->
pGroupbyExpr
))
{
// interval (down sampling operation)
tableIntervalProcessor
(
pQInfo
);
}
else
if
(
isFixedOutputQuery
(
pQuery
))
{
assert
(
pQuery
->
checkBuffer
==
0
);
tableFixedOutputProcessor
(
pQInfo
);
}
else
{
// diff/add/multiply/subtract/division
assert
(
pQuery
->
checkBuffer
==
1
);
...
...
@@ -5139,13 +5130,15 @@ static void tableQueryImpl(SQInfo* pQInfo) {
// record the total elapsed time
pQInfo
->
elapsedTime
+=
(
taosGetTimestampUs
()
-
st
);
assert
(
taosArrayGetSize
(
pQInfo
->
pTableIdList
)
==
1
);
/* check if query is killed or not */
if
(
isQueryKilled
(
pQInfo
))
{
dTrace
(
"QInfo:%p query is killed"
,
pQInfo
);
}
else
{
dTrace
(
"QInfo:%p query task completed, %"
PRId64
" rows will returned, total:%"
PRId64
" rows"
,
pQInfo
,
pQuery
->
rec
.
rows
,
pQuery
->
rec
.
total
);
STableId
*
pTableId
=
taosArrayGet
(
pQInfo
->
pTableIdList
,
0
);
dTrace
(
"QInfo:%p uid:%"
PRIu64
" tid:%d, query completed, %"
PRId64
" rows returned, numOfTotal:%"
PRId64
" rows"
,
pQInfo
,
pTableId
->
uid
,
pTableId
->
tid
,
pQuery
->
rec
.
rows
,
pQuery
->
rec
.
total
+
pQuery
->
rec
.
rows
);
}
sem_post
(
&
pQInfo
->
dataReady
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录