Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
adf085ab
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
adf085ab
编写于
10月 31, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
c11ed489
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
48 deletion
+41
-48
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+10
-10
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+30
-37
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
adf085ab
...
...
@@ -159,7 +159,7 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, SArray *pTabl
void
tsdbReaderClose
(
STsdbReader
*
pReader
);
bool
tsdbNextDataBlock
(
STsdbReader
*
pReader
);
bool
tsdbTableNextDataBlock
(
STsdbReader
*
pReader
,
int64_t
uid
);
void
tsdbRetrieveDataBlockInfo
(
STsdbReader
*
pReader
,
SDataBlockInfo
*
pDataBlockInfo
);
void
tsdbRetrieveDataBlockInfo
(
const
STsdbReader
*
pReader
,
int32_t
*
rows
,
uint64_t
*
uid
,
STimeWindow
*
pWindow
);
int32_t
tsdbRetrieveDatablockSMA
(
STsdbReader
*
pReader
,
SColumnDataAgg
***
pBlockStatis
,
bool
*
allHave
);
SArray
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
int32_t
tsdbReaderReset
(
STsdbReader
*
pReader
,
SQueryTableDataCond
*
pCond
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
adf085ab
...
...
@@ -3787,24 +3787,24 @@ bool tsdbTableNextDataBlock(STsdbReader* pReader, int64_t uid) {
return
true
;
}
static
void
setBlockInfo
(
STsdbReader
*
pReader
,
SDataBlockInfo
*
pDataBlockInfo
)
{
ASSERT
(
p
DataBlockInfo
!=
NULL
&&
p
Reader
!=
NULL
);
pDataBlockInfo
->
rows
=
pReader
->
pResBlock
->
info
.
rows
;
pDataBlockInfo
->
uid
=
pReader
->
pResBlock
->
info
.
uid
;
pDataBlockInfo
->
w
indow
=
pReader
->
pResBlock
->
info
.
window
;
static
void
setBlockInfo
(
const
STsdbReader
*
pReader
,
int32_t
*
rows
,
uint64_t
*
uid
,
STimeWindow
*
pWindow
)
{
ASSERT
(
pReader
!=
NULL
);
*
rows
=
pReader
->
pResBlock
->
info
.
rows
;
*
uid
=
pReader
->
pResBlock
->
info
.
uid
;
*
pW
indow
=
pReader
->
pResBlock
->
info
.
window
;
}
void
tsdbRetrieveDataBlockInfo
(
STsdbReader
*
pReader
,
SDataBlockInfo
*
pDataBlockInfo
)
{
void
tsdbRetrieveDataBlockInfo
(
const
STsdbReader
*
pReader
,
int32_t
*
rows
,
uint64_t
*
uid
,
STimeWindow
*
pWindow
)
{
if
(
pReader
->
type
==
TIMEWINDOW_RANGE_EXTERNAL
)
{
if
(
pReader
->
step
==
EXTERNAL_ROWS_MAIN
)
{
setBlockInfo
(
pReader
,
pDataBlockInfo
);
setBlockInfo
(
pReader
,
rows
,
uid
,
pWindow
);
}
else
if
(
pReader
->
step
==
EXTERNAL_ROWS_PREV
)
{
setBlockInfo
(
pReader
->
innerReader
[
0
],
pDataBlockInfo
);
setBlockInfo
(
pReader
->
innerReader
[
0
],
rows
,
uid
,
pWindow
);
}
else
{
setBlockInfo
(
pReader
->
innerReader
[
1
],
pDataBlockInfo
);
setBlockInfo
(
pReader
->
innerReader
[
1
],
rows
,
uid
,
pWindow
);
}
}
else
{
setBlockInfo
(
pReader
,
pDataBlockInfo
);
setBlockInfo
(
pReader
,
rows
,
uid
,
pWindow
);
}
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
adf085ab
...
...
@@ -618,13 +618,14 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) {
blockDataCleanup
(
pBlock
);
SDataBlockInfo
binfo
=
pBlock
->
info
;
tsdbRetrieveDataBlockInfo
(
pTableScanInfo
->
dataReader
,
&
binfo
);
SDataBlockInfo
*
pBInfo
=
&
pBlock
->
info
;
binfo
.
capacity
=
binfo
.
rows
;
blockDataEnsureCapacity
(
pBlock
,
binfo
.
rows
);
pBlock
->
info
=
binfo
;
ASSERT
(
binfo
.
uid
!=
0
);
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
pTableScanInfo
->
dataReader
,
&
rows
,
&
pBInfo
->
uid
,
&
pBInfo
->
window
);
blockDataEnsureCapacity
(
pBlock
,
rows
);
pBlock
->
info
.
rows
=
rows
;
ASSERT
(
pBInfo
->
uid
!=
0
);
pBlock
->
info
.
groupId
=
getTableGroupId
(
&
pTaskInfo
->
tableqinfoList
,
pBlock
->
info
.
uid
);
...
...
@@ -1120,20 +1121,19 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU
bool
hasBlock
=
tsdbNextDataBlock
(
pReader
);
if
(
hasBlock
)
{
SDataBlockInfo
binfo
=
{
0
};
tsdbRetrieveDataBlockInfo
(
pReader
,
&
binfo
);
SDataBlockInfo
*
pBInfo
=
&
pBlock
->
info
;
SArray
*
pCols
=
tsdbRetrieveDataBlock
(
pReader
,
NULL
)
;
blockDataEnsureCapacity
(
pBlock
,
binfo
.
rows
);
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
pReader
,
&
rows
,
&
pBInfo
->
uid
,
&
pBInfo
->
window
);
pBlock
->
info
.
window
=
binfo
.
window
;
pBlock
->
info
.
uid
=
binfo
.
uid
;
pB
lock
->
info
.
rows
=
binfo
.
rows
;
SArray
*
pCols
=
tsdbRetrieveDataBlock
(
pReader
,
NULL
)
;
blockDataEnsureCapacity
(
pBlock
,
pBInfo
->
rows
)
;
pB
Info
->
rows
=
rows
;
relocateColumnData
(
pBlock
,
pTableScanInfo
->
matchInfo
.
pList
,
pCols
,
true
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
);
pBlock
->
info
.
groupId
=
getTableGroupId
(
&
pTaskInfo
->
tableqinfoList
,
binfo
.
uid
);
pBlock
->
info
.
groupId
=
getTableGroupId
(
&
pTaskInfo
->
tableqinfoList
,
pBInfo
->
uid
);
}
tsdbReaderClose
(
pReader
);
...
...
@@ -2121,7 +2121,9 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) {
longjmp
(
pTaskInfo
->
env
,
TSDB_CODE_TSC_QUERY_CANCELLED
);
}
tsdbRetrieveDataBlockInfo
(
pInfo
->
dataReader
,
&
pBlock
->
info
);
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
pInfo
->
dataReader
,
&
rows
,
&
pBlock
->
info
.
uid
,
&
pBlock
->
info
.
window
);
pBlock
->
info
.
rows
=
rows
;
SArray
*
pCols
=
tsdbRetrieveDataBlock
(
pInfo
->
dataReader
,
NULL
);
pBlock
->
pDataBlock
=
pCols
;
...
...
@@ -4561,14 +4563,11 @@ static SSDataBlock* getTableDataBlockTemp(void* param) {
}
blockDataCleanup
(
pBlock
);
SDataBlockInfo
binfo
=
pBlock
->
info
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
binfo
);
blockDataEnsureCapacity
(
pBlock
,
binfo
.
rows
);
pBlock
->
info
.
type
=
binfo
.
type
;
pBlock
->
info
.
uid
=
binfo
.
uid
;
pBlock
->
info
.
window
=
binfo
.
window
;
pBlock
->
info
.
rows
=
binfo
.
rows
;
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
rows
,
&
pBlock
->
info
.
uid
,
&
pBlock
->
info
.
window
);
blockDataEnsureCapacity
(
pBlock
,
rows
);
pBlock
->
info
.
rows
=
rows
;
if
(
tsdbIsAscendingOrder
(
pInfo
->
pReader
))
{
pQueryCond
->
twindows
.
skey
=
pBlock
->
info
.
window
.
ekey
+
1
;
...
...
@@ -4627,14 +4626,11 @@ static SSDataBlock* getTableDataBlock2(void* param) {
}
blockDataCleanup
(
pBlock
);
SDataBlockInfo
binfo
=
pBlock
->
info
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
binfo
);
blockDataEnsureCapacity
(
pBlock
,
binfo
.
rows
);
pBlock
->
info
.
type
=
binfo
.
type
;
pBlock
->
info
.
uid
=
binfo
.
uid
;
pBlock
->
info
.
window
=
binfo
.
window
;
pBlock
->
info
.
rows
=
binfo
.
rows
;
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
rows
,
&
pBlock
->
info
.
uid
,
&
pBlock
->
info
.
window
);
blockDataEnsureCapacity
(
pBlock
,
rows
);
pBlock
->
info
.
rows
=
rows
;
uint32_t
status
=
0
;
int32_t
code
=
loadDataBlockFromOneTable2
(
pOperator
,
pTableScanInfo
,
pBlock
,
&
status
);
...
...
@@ -4684,14 +4680,11 @@ static SSDataBlock* getTableDataBlock(void* param) {
}
blockDataCleanup
(
pBlock
);
SDataBlockInfo
binfo
=
pBlock
->
info
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
binfo
);
blockDataEnsureCapacity
(
pBlock
,
binfo
.
rows
);
pBlock
->
info
.
type
=
binfo
.
type
;
pBlock
->
info
.
uid
=
binfo
.
uid
;
pBlock
->
info
.
window
=
binfo
.
window
;
pBlock
->
info
.
rows
=
binfo
.
rows
;
int32_t
rows
=
0
;
tsdbRetrieveDataBlockInfo
(
reader
,
&
rows
,
&
pBlock
->
info
.
uid
,
&
pBlock
->
info
.
window
);
blockDataEnsureCapacity
(
pBlock
,
rows
);
pBlock
->
info
.
rows
=
rows
;
uint32_t
status
=
0
;
int32_t
code
=
loadDataBlockFromOneTable
(
pOperator
,
pTableScanInfo
,
readerIdx
,
pBlock
,
&
status
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录