Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ba50a7c3
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看板
提交
ba50a7c3
编写于
12月 12, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): add additional attribute to denote if current block has already loaded data.
上级
6283581c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
3 deletion
+10
-3
include/common/tcommon.h
include/common/tcommon.h
+1
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+5
-3
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+4
-0
未找到文件。
include/common/tcommon.h
浏览文件 @
ba50a7c3
...
@@ -195,6 +195,7 @@ typedef struct SDataBlockInfo {
...
@@ -195,6 +195,7 @@ typedef struct SDataBlockInfo {
uint32_t
capacity
;
uint32_t
capacity
;
SBlockID
id
;
SBlockID
id
;
int16_t
hasVarCol
;
int16_t
hasVarCol
;
int16_t
dataLoad
;
// denote if the data is loaded or not
// TODO: optimize and remove following
// TODO: optimize and remove following
int64_t
version
;
// used for stream, and need serialization
int64_t
version
;
// used for stream, and need serialization
...
...
source/common/src/tdatablock.c
浏览文件 @
ba50a7c3
...
@@ -358,7 +358,7 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz
...
@@ -358,7 +358,7 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz
size_t
blockDataGetNumOfRows
(
const
SSDataBlock
*
pBlock
)
{
return
pBlock
->
info
.
rows
;
}
size_t
blockDataGetNumOfRows
(
const
SSDataBlock
*
pBlock
)
{
return
pBlock
->
info
.
rows
;
}
int32_t
blockDataUpdateTsWindow
(
SSDataBlock
*
pDataBlock
,
int32_t
tsColumnIndex
)
{
int32_t
blockDataUpdateTsWindow
(
SSDataBlock
*
pDataBlock
,
int32_t
tsColumnIndex
)
{
if
(
pDataBlock
==
NULL
||
pDataBlock
->
info
.
rows
<=
0
)
{
if
(
pDataBlock
==
NULL
||
pDataBlock
->
info
.
rows
<=
0
||
pDataBlock
->
info
.
dataLoad
==
0
)
{
return
0
;
return
0
;
}
}
...
@@ -1157,13 +1157,14 @@ void blockDataEmpty(SSDataBlock* pDataBlock) {
...
@@ -1157,13 +1157,14 @@ void blockDataEmpty(SSDataBlock* pDataBlock) {
}
}
pInfo
->
rows
=
0
;
pInfo
->
rows
=
0
;
pInfo
->
dataLoad
=
0
;
pInfo
->
window
.
ekey
=
0
;
pInfo
->
window
.
ekey
=
0
;
pInfo
->
window
.
skey
=
0
;
pInfo
->
window
.
skey
=
0
;
}
}
// todo temporarily disable it
// todo temporarily disable it
static
int32_t
doEnsureCapacity
(
SColumnInfoData
*
pColumn
,
const
SDataBlockInfo
*
pBlockInfo
,
uint32_t
numOfRows
,
bool
clearPayload
)
{
static
int32_t
doEnsureCapacity
(
SColumnInfoData
*
pColumn
,
const
SDataBlockInfo
*
pBlockInfo
,
uint32_t
numOfRows
,
bool
clearPayload
)
{
ASSERT
(
numOfRows
>
0
/*&& pBlockInfo->capacity >= pBlockInfo->rows*/
);
ASSERT
(
numOfRows
>
0
);
if
(
numOfRows
<=
pBlockInfo
->
capacity
)
{
if
(
numOfRows
<=
pBlockInfo
->
capacity
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -2427,6 +2428,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
...
@@ -2427,6 +2428,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
pStart
+=
colLen
[
i
];
pStart
+=
colLen
[
i
];
}
}
pBlock
->
info
.
dataLoad
=
1
;
pBlock
->
info
.
rows
=
numOfRows
;
pBlock
->
info
.
rows
=
numOfRows
;
ASSERT
(
pStart
-
pData
==
dataLen
);
ASSERT
(
pStart
-
pData
==
dataLen
);
return
pStart
;
return
pStart
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
ba50a7c3
...
@@ -1143,6 +1143,7 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn
...
@@ -1143,6 +1143,7 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn
i
+=
1
;
i
+=
1
;
}
}
pResBlock
->
info
.
dataLoad
=
1
;
pResBlock
->
info
.
rows
=
dumpedRows
;
pResBlock
->
info
.
rows
=
dumpedRows
;
pDumpInfo
->
rowIndex
+=
step
*
dumpedRows
;
pDumpInfo
->
rowIndex
+=
step
*
dumpedRows
;
...
@@ -2538,6 +2539,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
...
@@ -2538,6 +2539,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
_end:
_end:
pResBlock
->
info
.
id
.
uid
=
(
pBlockScanInfo
!=
NULL
)
?
pBlockScanInfo
->
uid
:
0
;
pResBlock
->
info
.
id
.
uid
=
(
pBlockScanInfo
!=
NULL
)
?
pBlockScanInfo
->
uid
:
0
;
pResBlock
->
info
.
dataLoad
=
1
;
blockDataUpdateTsWindow
(
pResBlock
,
pReader
->
suppInfo
.
slotId
[
0
]);
blockDataUpdateTsWindow
(
pResBlock
,
pReader
->
suppInfo
.
slotId
[
0
]);
setComposedBlockFlag
(
pReader
,
true
);
setComposedBlockFlag
(
pReader
,
true
);
...
@@ -3622,6 +3624,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow*
...
@@ -3622,6 +3624,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow*
i
+=
1
;
i
+=
1
;
}
}
pBlock
->
info
.
dataLoad
=
1
;
pBlock
->
info
.
rows
+=
1
;
pBlock
->
info
.
rows
+=
1
;
pScanInfo
->
lastKey
=
pTSRow
->
ts
;
pScanInfo
->
lastKey
=
pTSRow
->
ts
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -3669,6 +3672,7 @@ int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pReader, S
...
@@ -3669,6 +3672,7 @@ int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pReader, S
i
+=
1
;
i
+=
1
;
}
}
pResBlock
->
info
.
dataLoad
=
1
;
pResBlock
->
info
.
rows
+=
1
;
pResBlock
->
info
.
rows
+=
1
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录