Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4f16771d
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看板
提交
4f16771d
编写于
8月 17, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:error in get table list by tag filter
上级
171ce325
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
22 deletion
+10
-22
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-1
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+4
-17
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+5
-4
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
4f16771d
...
...
@@ -91,7 +91,7 @@ typedef struct SMetaEntry SMetaEntry;
void
metaReaderInit
(
SMetaReader
*
pReader
,
SMeta
*
pMeta
,
int32_t
flags
);
void
metaReaderClear
(
SMetaReader
*
pReader
);
int32_t
metaGetTableEntryByUid
(
SMetaReader
*
pReader
,
tb_uid_t
uid
);
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
S
Array
*
tags
);
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
S
HashObj
*
tags
);
int32_t
metaReadNext
(
SMetaReader
*
pReader
);
const
void
*
metaGetTableTagVal
(
void
*
tag
,
int16_t
type
,
STagVal
*
tagVal
);
int
metaGetTableNameByUid
(
void
*
meta
,
uint64_t
uid
,
char
*
tbName
);
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
4f16771d
...
...
@@ -962,13 +962,13 @@ END:
return
ret
;
}
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
S
Array
*
tags
)
{
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
S
HashObj
*
tags
)
{
SMCtbCursor
*
pCur
=
metaOpenCtbCursor
(
pMeta
,
suid
);
SHashObj
*
uHash
=
NULL
;
size_t
len
=
taosArrayGetSize
(
uidList
);
// len > 0 means there already have uids
if
(
len
>
0
){
uHash
=
taosHashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
tru
e
,
HASH_NO_LOCK
);
uHash
=
taosHashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
fals
e
,
HASH_NO_LOCK
);
for
(
int
i
=
0
;
i
<
len
;
i
++
){
int64_t
*
uid
=
taosArrayGet
(
uidList
,
i
);
taosHashPut
(
uHash
,
uid
,
sizeof
(
int64_t
),
&
i
,
sizeof
(
i
));
...
...
@@ -982,26 +982,13 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList, SArray *t
if
(
len
>
0
&&
taosHashGet
(
uHash
,
&
id
,
sizeof
(
int64_t
))
==
NULL
)
{
continue
;
}
void
*
tag
=
taosMemoryMalloc
(
pCur
->
vLen
);
memcpy
(
tag
,
pCur
->
pVal
,
pCur
->
vLen
);
if
(
len
==
0
)
{
}
else
if
(
len
==
0
)
{
taosArrayPush
(
uidList
,
&
id
);
taosArrayPush
(
tags
,
&
tag
);
}
else
{
taosHashPut
(
uHash
,
&
id
,
sizeof
(
int64_t
),
&
tag
,
POINTER_BYTES
);
}
}
for
(
int
i
=
0
;
i
<
len
;
i
++
){
int64_t
*
uid
=
taosArrayGet
(
uidList
,
i
);
void
**
tag
=
taosHashGet
(
uHash
,
uid
,
POINTER_BYTES
);
taosArrayPush
(
tags
,
tag
);
taosHashPut
(
tags
,
&
id
,
sizeof
(
int64_t
),
pCur
->
pVal
,
pCur
->
vLen
);
}
taosHashCleanup
(
uHash
);
metaCloseCtbCursor
(
pCur
);
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
4f16771d
...
...
@@ -368,7 +368,7 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
int32_t
code
=
TSDB_CODE_SUCCESS
;
SArray
*
pBlockList
=
NULL
;
SSDataBlock
*
pResBlock
=
NULL
;
S
Array
*
tags
=
NULL
;
S
HashObj
*
tags
=
NULL
;
SScalarParam
output
=
{
0
};
tagFilterAssist
ctx
=
{
0
};
...
...
@@ -399,7 +399,7 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
}
// int64_t stt = taosGetTimestampUs();
tags
=
taos
ArrayInit
(
8
,
POINTER_BYTES
);
tags
=
taos
HashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
code
=
metaGetTableTags
(
metaHandle
,
suid
,
uidList
,
tags
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
...
...
@@ -421,8 +421,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
// int64_t st = taosGetTimestampUs();
for
(
int32_t
i
=
0
;
i
<
rows
;
i
++
)
{
void
*
tag
=
taosArrayGetP
(
tags
,
i
);
int64_t
*
uid
=
taosArrayGet
(
uidList
,
i
);
void
*
tag
=
taosHashGet
(
tags
,
uid
,
sizeof
(
int64_t
));
ASSERT
(
tag
);
for
(
int32_t
j
=
0
;
j
<
taosArrayGetSize
(
pResBlock
->
pDataBlock
);
j
++
){
SColumnInfoData
*
pColInfo
=
(
SColumnInfoData
*
)
taosArrayGet
(
pResBlock
->
pDataBlock
,
j
);
...
...
@@ -474,7 +475,7 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
// qDebug("calculate tag block rows:%d, cost:%ld us", rows, st2-st1);
end:
taos
ArrayDestroyP
(
tags
,
taosMemoryFree
);
taos
HashCleanup
(
tags
);
taosHashCleanup
(
ctx
.
colHash
);
taosArrayDestroy
(
ctx
.
cInfoList
);
blockDataDestroy
(
pResBlock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录