Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4774baa6
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看板
提交
4774baa6
编写于
10月 27, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): handle the case of the single block in last files.
上级
d8102fc8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
21 deletion
+31
-21
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+1
-2
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+22
-15
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+7
-3
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
4774baa6
...
...
@@ -100,7 +100,6 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
int32_t
tsdbCacherowsReaderOpen
(
void
*
pVnode
,
int32_t
type
,
void
*
pTableIdList
,
int32_t
numOfTables
,
int32_t
numOfCols
,
uint64_t
suid
,
void
**
pReader
)
{
*
pReader
=
NULL
;
SCacheRowsReader
*
p
=
taosMemoryCalloc
(
1
,
sizeof
(
SCacheRowsReader
));
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -119,6 +118,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
STableKeyInfo
*
pKeyInfo
=
&
((
STableKeyInfo
*
)
pTableIdList
)[
0
];
p
->
pSchema
=
metaGetTbTSchema
(
p
->
pVnode
->
pMeta
,
pKeyInfo
->
uid
,
-
1
,
1
);
p
->
pTableList
=
pTableIdList
;
p
->
numOfTables
=
numOfTables
;
p
->
transferBuf
=
taosMemoryCalloc
(
p
->
pSchema
->
numOfCols
,
POINTER_BYTES
);
if
(
p
->
transferBuf
==
NULL
)
{
...
...
@@ -205,7 +205,6 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
SLRUCache
*
lruCache
=
pr
->
pVnode
->
pTsdb
->
lruCache
;
LRUHandle
*
h
=
NULL
;
SArray
*
pRow
=
NULL
;
// size_t numOfTables = taosArrayGetSize(pr->pTableList);
bool
hasRes
=
false
;
SArray
*
pLastCols
=
NULL
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
4774baa6
...
...
@@ -270,24 +270,27 @@ static void resetDataBlockScanInfo(SHashObj* pTableMap, int64_t ts) {
}
}
static
void
destroyBlockScanInfo
(
SHashObj
*
pTableMap
)
{
STableBlockScanInfo
*
p
=
NULL
;
static
void
clearBlockScanInfo
(
STableBlockScanInfo
*
p
)
{
p
->
iterInit
=
false
;
p
->
iiter
.
hasVal
=
false
;
while
((
p
=
taosHashIterate
(
pTableMap
,
p
))
!=
NULL
)
{
p
->
iter
Init
=
false
;
p
->
iiter
.
hasVal
=
false
;
if
(
p
->
iter
.
iter
!=
NULL
)
{
p
->
iter
.
iter
=
tsdbTbDataIterDestroy
(
p
->
iter
.
iter
)
;
}
if
(
p
->
iter
.
iter
!=
NULL
)
{
p
->
iter
.
iter
=
tsdbTbDataIterDestroy
(
p
->
iter
.
iter
);
}
if
(
p
->
i
iter
.
iter
!=
NULL
)
{
p
->
iiter
.
iter
=
tsdbTbDataIterDestroy
(
p
->
i
iter
.
iter
);
}
if
(
p
->
iiter
.
iter
!=
NULL
)
{
p
->
iiter
.
iter
=
tsdbTbDataIterDestroy
(
p
->
iiter
.
iter
);
}
p
->
delSkyline
=
taosArrayDestroy
(
p
->
delSkyline
);
p
->
pBlockList
=
taosArrayDestroy
(
p
->
pBlockList
);
tMapDataClear
(
&
p
->
mapData
);
}
p
->
delSkyline
=
taosArrayDestroy
(
p
->
delSkyline
);
p
->
pBlockList
=
taosArrayDestroy
(
p
->
pBlockList
);
tMapDataClear
(
&
p
->
mapData
);
static
void
destroyBlockScanInfo
(
SHashObj
*
pTableMap
)
{
STableBlockScanInfo
*
p
=
NULL
;
while
((
p
=
taosHashIterate
(
pTableMap
,
p
))
!=
NULL
)
{
clearBlockScanInfo
(
p
);
}
taosHashCleanup
(
pTableMap
);
...
...
@@ -3455,10 +3458,14 @@ int32_t buildDataBlockFromBufImpl(STableBlockScanInfo* pBlockScanInfo, int64_t e
// TODO refactor: with createDataBlockScanInfo
int32_t
tsdbSetTableList
(
STsdbReader
*
pReader
,
const
void
*
pTableList
,
int32_t
num
)
{
ASSERT
(
pReader
!=
NULL
);
STableBlockScanInfo
*
p
=
NULL
;
while
((
p
=
taosHashIterate
(
pReader
->
status
.
pTableMap
,
p
))
!=
NULL
)
{
clearBlockScanInfo
(
p
);
}
taosHashClear
(
pReader
->
status
.
pTableMap
);
STableKeyInfo
*
pList
=
(
STableKeyInfo
*
)
pTableList
;
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
STableBlockScanInfo
info
=
{.
lastKey
=
0
,
.
uid
=
pList
[
i
].
uid
};
taosHashPut
(
pReader
->
status
.
pTableMap
,
&
info
.
uid
,
sizeof
(
uint64_t
),
&
info
,
sizeof
(
info
));
...
...
source/libs/executor/inc/executil.h
浏览文件 @
4774baa6
...
...
@@ -95,7 +95,7 @@ typedef struct SColMatchInfo {
int32_t
matchType
;
// determinate the source according to col id or slot id
}
SColMatchInfo
;
typedef
struct
{
typedef
struct
STableListInfo
{
bool
oneTableForEachGroup
;
int32_t
numOfGroups
;
int32_t
*
groupOffset
;
// keep the offset value for each group in the tableList
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
4774baa6
...
...
@@ -3658,13 +3658,17 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
SQueryTableDataCond
cond
=
{
0
};
int32_t
code
=
initTableblockDistQueryCond
(
pBlockNode
->
suid
,
&
cond
);
int32_t
code
=
initTableblockDistQueryCond
(
pBlockNode
->
suid
,
&
cond
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
}
void
*
pList
=
taosArrayGet
(
pTableListInfo
->
pTableList
,
0
);
size_t
num
=
taosArrayGetSize
(
pTableListInfo
->
pTableList
);
size_t
num
=
getTotalTables
(
pTableListInfo
);
void
*
pList
=
NULL
;
if
(
num
>
0
)
{
pList
=
taosArrayGet
(
pTableListInfo
->
pTableList
,
0
);
}
STsdbReader
*
pReader
=
NULL
;
tsdbReaderOpen
(
pHandle
->
vnode
,
&
cond
,
pList
,
num
,
&
pReader
,
""
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录