Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
buyaopa
TDengine
提交
36ae97a0
T
TDengine
项目概览
buyaopa
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
36ae97a0
编写于
10月 24, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1373] refactor
上级
6532bced
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
11 addition
and
26 deletion
+11
-26
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+3
-5
src/query/inc/qTsbuf.h
src/query/inc/qTsbuf.h
+3
-8
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-10
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+3
-3
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
36ae97a0
...
...
@@ -96,7 +96,7 @@ static int64_t doTSBlockIntersect(SSqlObj* pSql, SJoinSupporter* pSupporter1, SJ
tscInfo
(
"%"
PRId64
", tags:%"
PRId64
"
\t
%"
PRId64
", tags:%"
PRId64
,
elem1
.
ts
,
elem1
.
tag
.
i64Key
,
elem2
.
ts
,
elem2
.
tag
.
i64Key
);
#endif
int32_t
res
=
tVariantCompare
(
&
elem1
.
tag
,
&
elem2
.
tag
);
int32_t
res
=
tVariantCompare
(
elem1
.
tag
,
elem2
.
tag
);
if
(
res
==
-
1
||
(
res
==
0
&&
tsCompare
(
order
,
elem1
.
ts
,
elem2
.
ts
)))
{
if
(
!
tsBufNextPos
(
pSupporter1
->
pTSBuf
))
{
break
;
...
...
@@ -123,11 +123,9 @@ static int64_t doTSBlockIntersect(SSqlObj* pSql, SJoinSupporter* pSupporter1, SJ
win
->
ekey
=
elem1
.
ts
;
}
tsBufAppend
(
output1
,
elem1
.
vnode
,
&
elem1
.
tag
,
(
const
char
*
)
&
elem1
.
ts
,
sizeof
(
elem1
.
ts
));
tsBufAppend
(
output2
,
elem2
.
vnode
,
&
elem2
.
tag
,
(
const
char
*
)
&
elem2
.
ts
,
sizeof
(
elem2
.
ts
));
tsBufAppend
(
output1
,
elem1
.
vnode
,
elem1
.
tag
,
(
const
char
*
)
&
elem1
.
ts
,
sizeof
(
elem1
.
ts
));
tsBufAppend
(
output2
,
elem2
.
vnode
,
elem2
.
tag
,
(
const
char
*
)
&
elem2
.
ts
,
sizeof
(
elem2
.
ts
));
tVariantDestroy
(
&
elem1
.
tag
);
tVariantDestroy
(
&
elem2
.
tag
);
}
else
{
pLimit
->
offset
-=
1
;
}
...
...
src/query/inc/qTsbuf.h
浏览文件 @
36ae97a0
...
...
@@ -35,16 +35,9 @@ typedef struct STSList {
int32_t
len
;
}
STSList
;
typedef
struct
STSRawBlock
{
int32_t
vnode
;
int64_t
tag
;
TSKEY
*
ts
;
int32_t
len
;
}
STSRawBlock
;
typedef
struct
STSElem
{
TSKEY
ts
;
tVariant
tag
;
tVariant
*
tag
;
int32_t
vnode
;
}
STSElem
;
...
...
@@ -84,6 +77,7 @@ typedef struct STSBuf {
char
path
[
PATH_MAX
];
uint32_t
fileSize
;
// todo use array
STSVnodeBlockInfoEx
*
pData
;
uint32_t
numOfAlloc
;
uint32_t
numOfVnodes
;
...
...
@@ -121,6 +115,7 @@ void tsBufFlush(STSBuf* pTSBuf);
void
tsBufResetPos
(
STSBuf
*
pTSBuf
);
STSElem
tsBufGetElem
(
STSBuf
*
pTSBuf
);
bool
tsBufNextPos
(
STSBuf
*
pTSBuf
);
STSElem
tsBufGetElemStartPos
(
STSBuf
*
pTSBuf
,
int32_t
vnodeId
,
tVariant
*
tag
);
...
...
src/query/src/qExecutor.c
浏览文件 @
36ae97a0
...
...
@@ -1201,7 +1201,7 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) {
SQLFunctionCtx
*
pCtx
=
pRuntimeEnv
->
pCtx
;
// compare tag first
if
(
tVariantCompare
(
&
pCtx
[
0
].
tag
,
&
elem
.
tag
)
!=
0
)
{
if
(
tVariantCompare
(
&
pCtx
[
0
].
tag
,
elem
.
tag
)
!=
0
)
{
return
TS_JOIN_TAG_NOT_EQUALS
;
}
...
...
@@ -3888,7 +3888,6 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
qError
(
"QInfo:%p failed to find tag:%"
PRId64
" in ts_comp"
,
pQInfo
,
pTag
->
i64Key
);
}
tVariantDestroy
(
&
elem
.
tag
);
return
false
;
}
...
...
@@ -4815,7 +4814,6 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
qError
(
"QInfo:%p failed to find tag:%"
PRId64
" in ts_comp"
,
pQInfo
,
pTag
->
i64Key
);
}
tVariantDestroy
(
&
elem
.
tag
);
return
false
;
}
else
{
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pTSBuf
);
...
...
@@ -4830,7 +4828,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
}
}
else
{
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pTSBuf
);
if
(
tVariantCompare
(
&
elem
.
tag
,
&
pRuntimeEnv
->
pCtx
[
0
].
tag
)
!=
0
)
{
if
(
tVariantCompare
(
elem
.
tag
,
&
pRuntimeEnv
->
pCtx
[
0
].
tag
)
!=
0
)
{
STSElem
elem1
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pTSBuf
,
pQInfo
->
vgId
,
pTag
);
// failed to find data with the specified tag value and vnodeId
...
...
@@ -4841,9 +4839,6 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
qError
(
"QInfo:%p failed to find tag:%"
PRId64
" in ts_comp"
,
pQInfo
,
pTag
->
i64Key
);
}
tVariantDestroy
(
&
elem
.
tag
);
tVariantDestroy
(
&
elem1
.
tag
);
return
false
;
}
else
{
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pTSBuf
);
...
...
@@ -4854,7 +4849,6 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
}
}
tVariantDestroy
(
&
elem1
.
tag
);
}
else
{
tsBufSetCursor
(
pRuntimeEnv
->
pTSBuf
,
&
pRuntimeEnv
->
cur
);
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pTSBuf
);
...
...
@@ -4864,8 +4858,6 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
qDebug
(
"QInfo:%p continue scan ts_comp file, tag:%"
PRId64
" blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
i64Key
,
cur
.
blockIndex
,
cur
.
tsIndex
);
}
}
tVariantDestroy
(
&
elem
.
tag
);
}
}
...
...
src/query/src/qTsbuf.c
浏览文件 @
36ae97a0
...
...
@@ -702,7 +702,7 @@ STSElem tsBufGetElem(STSBuf* pTSBuf) {
elem1
.
vnode
=
pTSBuf
->
pData
[
pCur
->
vgroupIndex
].
info
.
vnode
;
elem1
.
ts
=
*
(
TSKEY
*
)(
pTSBuf
->
tsData
.
rawBuf
+
pCur
->
tsIndex
*
TSDB_KEYSIZE
);
tVariantAssign
(
&
elem1
.
tag
,
&
pBlock
->
tag
)
;
elem1
.
tag
=
&
pBlock
->
tag
;
return
elem1
;
}
...
...
@@ -913,8 +913,8 @@ void tsBufDisplay(STSBuf* pTSBuf) {
while
(
tsBufNextPos
(
pTSBuf
))
{
STSElem
elem
=
tsBufGetElem
(
pTSBuf
);
if
(
elem
.
tag
.
nType
==
TSDB_DATA_TYPE_BIGINT
)
{
printf
(
"%d-%"
PRId64
"-%"
PRId64
"
\n
"
,
elem
.
vnode
,
elem
.
tag
.
i64Key
,
elem
.
ts
);
if
(
elem
.
tag
->
nType
==
TSDB_DATA_TYPE_BIGINT
)
{
printf
(
"%d-%"
PRId64
"-%"
PRId64
"
\n
"
,
elem
.
vnode
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录