Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
72287a3b
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看板
提交
72287a3b
编写于
2月 10, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): set correct tag value during tag filter and do some internal refactor.
上级
e46657ad
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
295 addition
and
155 deletion
+295
-155
include/common/tcommon.h
include/common/tcommon.h
+2
-2
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+4
-1
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
+14
-12
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+274
-139
未找到文件。
include/common/tcommon.h
浏览文件 @
72287a3b
...
...
@@ -367,11 +367,11 @@ typedef struct SSortExecInfo {
int32_t
readBytes
;
// read io bytes
}
SSortExecInfo
;
typedef
struct
S
FilterTable
Info
{
typedef
struct
S
TUidTag
Info
{
char
*
name
;
uint64_t
uid
;
void
*
pTagVal
;
}
S
FilterTable
Info
;
}
S
TUidTag
Info
;
// stream special block column
...
...
source/common/src/tdatablock.c
浏览文件 @
72287a3b
...
...
@@ -1546,7 +1546,10 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
}
void
colDataDestroy
(
SColumnInfoData
*
pColData
)
{
if
(
!
pColData
)
return
;
if
(
!
pColData
)
{
return
;
}
if
(
IS_VAR_DATA_TYPE
(
pColData
->
info
.
type
))
{
taosMemoryFreeClear
(
pColData
->
varmeta
.
offset
);
}
else
{
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
72287a3b
...
...
@@ -104,7 +104,7 @@ void metaReaderClear(SMetaReader *pReader);
int32_t
metaGetTableEntryByUid
(
SMetaReader
*
pReader
,
tb_uid_t
uid
);
int32_t
metaGetTableEntryByUidCache
(
SMetaReader
*
pReader
,
tb_uid_t
uid
);
int
metaGetTableEntryByName
(
SMetaReader
*
pReader
,
const
char
*
name
);
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
SHashObj
*
tags
);
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
);
int32_t
metaGetTableTagsByUids
(
SMeta
*
pMeta
,
int64_t
suid
,
SArray
*
uidList
);
int32_t
metaReadNext
(
SMetaReader
*
pReader
);
const
void
*
metaGetTableTagVal
(
void
*
tag
,
int16_t
type
,
STagVal
*
tagVal
);
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
72287a3b
...
...
@@ -1378,7 +1378,7 @@ int32_t metaGetTableTagsByUids(SMeta *pMeta, int64_t suid, SArray *uidList) {
int32_t
isLock
=
false
;
int32_t
sz
=
uidList
?
taosArrayGetSize
(
uidList
)
:
0
;
for
(
int
i
=
0
;
i
<
sz
;
i
++
)
{
S
FilterTable
Info
*
p
=
taosArrayGet
(
uidList
,
i
);
S
TUidTag
Info
*
p
=
taosArrayGet
(
uidList
,
i
);
if
(
i
%
LIMIT
==
0
)
{
if
(
isLock
)
metaULock
(
pMeta
);
...
...
@@ -1404,18 +1404,18 @@ int32_t metaGetTableTagsByUids(SMeta *pMeta, int64_t suid, SArray *uidList) {
return
0
;
}
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
SHashObj
*
tags
)
{
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
pUidTagInfo
)
{
SMCtbCursor
*
pCur
=
metaOpenCtbCursor
(
pMeta
,
suid
,
1
);
// If len > 0 means there already have uids, and we only want the
// tags of the specified tables, of which uid in the uid list. Otherwise, all table tags are retrieved and kept
// in the hash map, that may require a lot of memory
SHashObj
*
pSepecifiedUidMap
=
NULL
;
size_t
len
=
taosArrayGetSize
(
uidList
);
if
(
len
>
0
)
{
pSepecifiedUidMap
=
taosHashInit
(
len
/
0
.
7
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
int64_t
*
uid
=
taosArrayGet
(
uidList
,
i
);
size_t
numOfElems
=
taosArrayGetSize
(
pUidTagInfo
);
if
(
numOfElems
>
0
)
{
pSepecifiedUidMap
=
taosHashInit
(
numOfElems
/
0
.
7
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
for
(
int
i
=
0
;
i
<
numOfElems
;
i
++
)
{
int64_t
*
uid
=
taosArrayGet
(
pUidTagInfo
,
i
);
taosHashPut
(
pSepecifiedUidMap
,
uid
,
sizeof
(
int64_t
),
0
,
0
);
}
}
...
...
@@ -1426,13 +1426,15 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList, SHashObj
break
;
}
if
(
len
>
0
&&
taosHashGet
(
pSepecifiedUidMap
,
&
uid
,
sizeof
(
int64_t
))
==
NULL
)
{
if
(
numOfElems
>
0
&&
taosHashGet
(
pSepecifiedUidMap
,
&
uid
,
sizeof
(
int64_t
))
==
NULL
)
{
continue
;
}
else
if
(
len
==
0
)
{
taosArrayPush
(
uidList
,
&
uid
);
}
}
else
if
(
numOfElems
==
0
)
{
STUidTagInfo
info
=
{.
uid
=
uid
,
.
pTagVal
=
pCur
->
pVal
};
info
.
pTagVal
=
taosMemoryMalloc
(
pCur
->
vLen
);
memcpy
(
info
.
pTagVal
,
pCur
->
pVal
,
pCur
->
vLen
);
taosHashPut
(
tags
,
&
uid
,
sizeof
(
uint64_t
),
pCur
->
pVal
,
pCur
->
vLen
);
taosArrayPush
(
pUidTagInfo
,
&
info
);
}
}
taosHashCleanup
(
pSepecifiedUidMap
);
...
...
source/libs/executor/src/executil.c
浏览文件 @
72287a3b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录