Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8c62d5f9
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看板
提交
8c62d5f9
编写于
12月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix bug in tsdbread.
上级
9f55ca7f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
25 deletion
+30
-25
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+4
-5
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+6
-7
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+20
-13
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
8c62d5f9
...
...
@@ -1621,7 +1621,7 @@ static int32_t buildDataBlockFromBuf(STsdbReader* pReader, STableBlockScanInfo*
int64_t
st
=
taosGetTimestampUs
();
int32_t
code
=
buildDataBlockFromBufImpl
(
pBlockScanInfo
,
endKey
,
pReader
->
capacity
,
pReader
);
blockDataUpdateTsWindow
(
pBlock
,
0
);
blockDataUpdateTsWindow
(
pBlock
,
pReader
->
suppInfo
.
slotIds
[
0
]
);
pBlock
->
info
.
id
.
uid
=
pBlockScanInfo
->
uid
;
setComposedBlockFlag
(
pReader
,
true
);
...
...
@@ -2493,7 +2493,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
_end:
pResBlock
->
info
.
id
.
uid
=
(
pBlockScanInfo
!=
NULL
)
?
pBlockScanInfo
->
uid
:
0
;
blockDataUpdateTsWindow
(
pResBlock
,
0
);
blockDataUpdateTsWindow
(
pResBlock
,
pReader
->
suppInfo
.
slotIds
[
0
]
);
setComposedBlockFlag
(
pReader
,
true
);
double
el
=
(
taosGetTimestampUs
()
-
st
)
/
1000
.
0
;
...
...
@@ -3534,7 +3534,6 @@ int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pR
int32_t
doAppendRowFromTSRow
(
SSDataBlock
*
pBlock
,
STsdbReader
*
pReader
,
STSRow
*
pTSRow
,
STableBlockScanInfo
*
pScanInfo
)
{
int32_t
outputRowIndex
=
pBlock
->
info
.
rows
;
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
pBlock
->
pDataBlock
);
int64_t
uid
=
pScanInfo
->
uid
;
SBlockLoadSuppInfo
*
pSupInfo
=
&
pReader
->
suppInfo
;
...
...
@@ -3549,7 +3548,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow*
i
+=
1
;
}
while
(
i
<
numOfCols
&&
j
<
pSchema
->
numOfCols
)
{
while
(
i
<
pSupInfo
->
numOfCols
&&
j
<
pSchema
->
numOfCols
)
{
col_id_t
colId
=
pSupInfo
->
colIds
[
i
];
if
(
colId
==
pSchema
->
columns
[
j
].
colId
)
{
...
...
@@ -3570,7 +3569,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow*
}
// set null value since current column does not exist in the "pSchema"
while
(
i
<
numOfCols
)
{
while
(
i
<
pSupInfo
->
numOfCols
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pSupInfo
->
slotIds
[
i
]);
colDataAppendNULL
(
pColInfoData
,
outputRowIndex
);
i
+=
1
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
8c62d5f9
...
...
@@ -2513,10 +2513,8 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
int32_t
readIdx
=
source
->
readerIdx
;
SSDataBlock
*
pBlock
=
source
->
inputBlock
;
STableMergeScanInfo
*
pTableScanInfo
=
pOperator
->
info
;
SQueryTableDataCond
*
pQueryCond
=
taosArrayGet
(
pTableScanInfo
->
queryConds
,
readIdx
);
blockDataCleanup
(
pBlock
);
SQueryTableDataCond
*
pQueryCond
=
taosArrayGet
(
pInfo
->
queryConds
,
readIdx
);
int64_t
st
=
taosGetTimestampUs
();
void
*
p
=
tableListGetInfo
(
pTaskInfo
->
pTableInfoList
,
readIdx
+
pInfo
->
tableStartIndex
);
...
...
@@ -2534,12 +2532,11 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
}
// process this data block based on the probabilities
bool
processThisBlock
=
processBlockWithProbability
(
&
p
TableScan
Info
->
sample
);
bool
processThisBlock
=
processBlockWithProbability
(
&
pInfo
->
sample
);
if
(
!
processThisBlock
)
{
continue
;
}
blockDataCleanup
(
pBlock
);
if
(
pQueryCond
->
order
==
TSDB_ORDER_ASC
)
{
pQueryCond
->
twindows
.
skey
=
pBlock
->
info
.
window
.
ekey
+
1
;
}
else
{
...
...
@@ -2547,7 +2544,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
}
uint32_t
status
=
0
;
loadDataBlock
(
pOperator
,
&
p
TableScan
Info
->
base
,
pBlock
,
&
status
);
loadDataBlock
(
pOperator
,
&
pInfo
->
base
,
pBlock
,
&
status
);
// code = loadDataBlockFromOneTable(pOperator, pTableScanInfo, pBlock, &status);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
T_LONG_JMP
(
pTaskInfo
->
env
,
code
);
...
...
@@ -2561,7 +2558,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
pBlock
->
info
.
id
.
groupId
=
getTableGroupId
(
pTaskInfo
->
pTableInfoList
,
pBlock
->
info
.
id
.
uid
);
pOperator
->
resultInfo
.
totalRows
+=
pBlock
->
info
.
rows
;
p
TableScan
Info
->
base
.
readRecorder
.
elapsedTime
+=
(
taosGetTimestampUs
()
-
st
)
/
1000
.
0
;
pInfo
->
base
.
readRecorder
.
elapsedTime
+=
(
taosGetTimestampUs
()
-
st
)
/
1000
.
0
;
tsdbReaderClose
(
pInfo
->
base
.
dataReader
);
pInfo
->
base
.
dataReader
=
NULL
;
...
...
@@ -2641,6 +2638,8 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) {
param
.
readerIdx
=
i
;
param
.
pOperator
=
pOperator
;
param
.
inputBlock
=
createOneDataBlock
(
pInfo
->
pResBlock
,
false
);
blockDataEnsureCapacity
(
param
.
inputBlock
,
pOperator
->
resultInfo
.
capacity
);
taosArrayPush
(
pInfo
->
sortSourceParams
,
&
param
);
SQueryTableDataCond
cond
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
8c62d5f9
...
...
@@ -1659,22 +1659,11 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt
// the primary timestamp column
bool
needed
=
false
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SExprInfo
*
pExpr
=
pCtx
[
i
].
pExpr
;
if
(
fmIsIntervalInterpoFunc
(
pCtx
[
i
].
functionId
))
{
SFunctParam
*
pParam
=
&
pExpr
->
base
.
pParam
[
0
];
SColumn
c
=
*
pParam
->
pCol
;
taosArrayPush
(
pInfo
->
pInterpCols
,
&
c
);
needed
=
true
;
SGroupKeys
key
=
{
0
};
key
.
bytes
=
c
.
bytes
;
key
.
type
=
c
.
type
;
key
.
isNull
=
false
;
key
.
pData
=
taosMemoryCalloc
(
1
,
c
.
bytes
);
taosArrayPush
(
pInfo
->
pPrevValues
,
&
key
);
break
;
}
}
...
...
@@ -1699,6 +1688,24 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt
}
}
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SExprInfo
*
pExpr
=
pCtx
[
i
].
pExpr
;
if
(
fmIsIntervalInterpoFunc
(
pCtx
[
i
].
functionId
))
{
SFunctParam
*
pParam
=
&
pExpr
->
base
.
pParam
[
0
];
SColumn
c
=
*
pParam
->
pCol
;
taosArrayPush
(
pInfo
->
pInterpCols
,
&
c
);
SGroupKeys
key
=
{
0
};
key
.
bytes
=
c
.
bytes
;
key
.
type
=
c
.
type
;
key
.
isNull
=
false
;
key
.
pData
=
taosMemoryCalloc
(
1
,
c
.
bytes
);
taosArrayPush
(
pInfo
->
pPrevValues
,
&
key
);
}
}
return
needed
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录