Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f3dcb6ed
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f3dcb6ed
编写于
8月 24, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
merge from 2.0 to master
上级
6f8a5c4d
f39a1290
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
74 addition
and
20 deletion
+74
-20
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+49
-8
src/connector/python/examples/demo.py
src/connector/python/examples/demo.py
+1
-1
src/os/src/linux/linuxEnv.c
src/os/src/linux/linuxEnv.c
+14
-8
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+2
-2
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-0
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+1
-1
未找到文件。
src/client/src/tscServer.c
浏览文件 @
f3dcb6ed
...
@@ -841,6 +841,11 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) {
...
@@ -841,6 +841,11 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) {
tableSerialize
=
totalTables
*
sizeof
(
STableIdInfo
);
tableSerialize
=
totalTables
*
sizeof
(
STableIdInfo
);
}
}
SCond
*
pCond
=
&
pQueryInfo
->
tagCond
.
tbnameCond
;
if
(
pCond
->
len
>
0
)
{
srcColListSize
+=
pCond
->
len
;
}
return
MIN_QUERY_MSG_PKT_SIZE
+
minMsgSize
()
+
sizeof
(
SQueryTableMsg
)
+
srcColListSize
+
srcColFilterSize
+
srcTagFilterSize
+
return
MIN_QUERY_MSG_PKT_SIZE
+
minMsgSize
()
+
sizeof
(
SQueryTableMsg
)
+
srcColListSize
+
srcColFilterSize
+
srcTagFilterSize
+
exprSize
+
tsBufSize
+
tableSerialize
+
sqlLen
+
4096
+
pQueryInfo
->
bufLen
;
exprSize
+
tsBufSize
+
tableSerialize
+
sqlLen
+
4096
+
pQueryInfo
->
bufLen
;
}
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
f3dcb6ed
...
@@ -15,8 +15,9 @@
...
@@ -15,8 +15,9 @@
#define _GNU_SOURCE
#define _GNU_SOURCE
#include "os.h"
#include "os.h"
#include "texpr.h"
#include "texpr.h"
#include "tsched.h"
#include "qTsbuf.h"
#include "qTsbuf.h"
#include "tcompare.h"
#include "tcompare.h"
#include "tscLog.h"
#include "tscLog.h"
...
@@ -2425,6 +2426,26 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
...
@@ -2425,6 +2426,26 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
return
terrno
;
return
terrno
;
}
}
typedef
struct
SPair
{
int32_t
first
;
int32_t
second
;
}
SPair
;
static
void
doSendQueryReqs
(
SSchedMsg
*
pSchedMsg
)
{
SSqlObj
*
pSql
=
pSchedMsg
->
ahandle
;
SPair
*
p
=
pSchedMsg
->
msg
;
for
(
int32_t
i
=
p
->
first
;
i
<
p
->
second
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
SRetrieveSupport
*
pSupport
=
pSub
->
param
;
tscDebug
(
"0x%"
PRIx64
" sub:0x%"
PRIx64
" launch subquery, orderOfSub:%d."
,
pSql
->
self
,
pSub
->
self
,
pSupport
->
subqueryIndex
);
tscProcessSql
(
pSub
);
}
tfree
(
p
);
}
int32_t
tscHandleMasterSTableQuery
(
SSqlObj
*
pSql
)
{
int32_t
tscHandleMasterSTableQuery
(
SSqlObj
*
pSql
)
{
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
@@ -2547,13 +2568,33 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
...
@@ -2547,13 +2568,33 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
doCleanupSubqueries
(
pSql
,
i
);
doCleanupSubqueries
(
pSql
,
i
);
return
pRes
->
code
;
return
pRes
->
code
;
}
}
for
(
int32_t
j
=
0
;
j
<
pState
->
numOfSub
;
++
j
)
{
// concurrently sent the query requests.
SSqlObj
*
pSub
=
pSql
->
pSubs
[
j
];
const
int32_t
MAX_REQUEST_PER_TASK
=
8
;
SRetrieveSupport
*
pSupport
=
pSub
->
param
;
int32_t
numOfTasks
=
(
pState
->
numOfSub
+
MAX_REQUEST_PER_TASK
-
1
)
/
MAX_REQUEST_PER_TASK
;
tscDebug
(
"0x%"
PRIx64
" sub:0x%"
PRIx64
" launch subquery, orderOfSub:%d."
,
pSql
->
self
,
pSub
->
self
,
pSupport
->
subqueryIndex
);
assert
(
numOfTasks
>=
1
);
tscBuildAndSendRequest
(
pSub
,
NULL
);
int32_t
num
=
(
pState
->
numOfSub
/
numOfTasks
)
+
1
;
tscDebug
(
"0x%"
PRIx64
" query will be sent by %d threads"
,
pSql
->
self
,
numOfTasks
);
for
(
int32_t
j
=
0
;
j
<
numOfTasks
;
++
j
)
{
SSchedMsg
schedMsg
=
{
0
};
schedMsg
.
fp
=
doSendQueryReqs
;
schedMsg
.
ahandle
=
(
void
*
)
pSql
;
schedMsg
.
thandle
=
NULL
;
SPair
*
p
=
calloc
(
1
,
sizeof
(
SPair
));
p
->
first
=
j
*
num
;
if
(
j
==
numOfTasks
-
1
)
{
p
->
second
=
pState
->
numOfSub
;
}
else
{
p
->
second
=
(
j
+
1
)
*
num
;
}
schedMsg
.
msg
=
p
;
taosScheduleTask
(
tscQhandle
,
&
schedMsg
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
src/connector/python/examples/demo.py
浏览文件 @
f3dcb6ed
...
@@ -2,7 +2,7 @@ import taos
...
@@ -2,7 +2,7 @@ import taos
conn
=
taos
.
connect
(
host
=
'127.0.0.1'
,
conn
=
taos
.
connect
(
host
=
'127.0.0.1'
,
user
=
'root'
,
user
=
'root'
,
passwor
kd
=
'tao
data'
,
passwor
d
=
'taos
data'
,
database
=
'log'
)
database
=
'log'
)
cursor
=
conn
.
cursor
()
cursor
=
conn
.
cursor
()
...
...
src/os/src/linux/linuxEnv.c
浏览文件 @
f3dcb6ed
...
@@ -50,14 +50,20 @@ void osInit() {
...
@@ -50,14 +50,20 @@ void osInit() {
char
*
taosGetCmdlineByPID
(
int
pid
)
{
char
*
taosGetCmdlineByPID
(
int
pid
)
{
static
char
cmdline
[
1024
];
static
char
cmdline
[
1024
];
sprintf
(
cmdline
,
"/proc/%d/cmdline"
,
pid
);
sprintf
(
cmdline
,
"/proc/%d/cmdline"
,
pid
);
FILE
*
f
=
fopen
(
cmdline
,
"r"
);
if
(
f
)
{
int
fd
=
open
(
cmdline
,
O_RDONLY
);
size_t
size
;
if
(
fd
>=
0
)
{
size
=
fread
(
cmdline
,
sizeof
(
char
),
1024
,
f
);
int
n
=
read
(
fd
,
cmdline
,
sizeof
(
cmdline
)
-
1
);
if
(
size
>
0
)
{
if
(
n
<
0
)
n
=
0
;
if
(
'\n'
==
cmdline
[
size
-
1
])
cmdline
[
size
-
1
]
=
'\0'
;
}
if
(
n
>
0
&&
cmdline
[
n
-
1
]
==
'\n'
)
--
n
;
fclose
(
f
);
cmdline
[
n
]
=
0
;
close
(
fd
);
}
else
{
cmdline
[
0
]
=
0
;
}
}
return
cmdline
;
return
cmdline
;
}
}
src/query/src/qAggMain.c
浏览文件 @
f3dcb6ed
...
@@ -4089,7 +4089,7 @@ static void mergeTableBlockDist(SResultRowCellInfo* pResInfo, const STableBlockD
...
@@ -4089,7 +4089,7 @@ static void mergeTableBlockDist(SResultRowCellInfo* pResInfo, const STableBlockD
}
else
{
}
else
{
pDist
->
maxRows
=
pSrc
->
maxRows
;
pDist
->
maxRows
=
pSrc
->
maxRows
;
pDist
->
minRows
=
pSrc
->
minRows
;
pDist
->
minRows
=
pSrc
->
minRows
;
int32_t
maxSteps
=
TSDB_MAX_MAX_ROW_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
int32_t
maxSteps
=
TSDB_MAX_MAX_ROW_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
if
(
TSDB_MAX_MAX_ROW_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
if
(
TSDB_MAX_MAX_ROW_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
++
maxSteps
;
++
maxSteps
;
...
@@ -4223,7 +4223,7 @@ void blockinfo_func_finalizer(SQLFunctionCtx* pCtx) {
...
@@ -4223,7 +4223,7 @@ void blockinfo_func_finalizer(SQLFunctionCtx* pCtx) {
taosArrayDestroy
(
pDist
->
dataBlockInfos
);
taosArrayDestroy
(
pDist
->
dataBlockInfos
);
pDist
->
dataBlockInfos
=
NULL
;
pDist
->
dataBlockInfos
=
NULL
;
}
}
// cannot set the numOfIteratedElems again since it is set during previous iteration
// cannot set the numOfIteratedElems again since it is set during previous iteration
pResInfo
->
numOfRes
=
1
;
pResInfo
->
numOfRes
=
1
;
pResInfo
->
hasResult
=
DATA_SET_FLAG
;
pResInfo
->
hasResult
=
DATA_SET_FLAG
;
...
...
src/query/src/qExecutor.c
浏览文件 @
f3dcb6ed
...
@@ -7449,10 +7449,12 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
...
@@ -7449,10 +7449,12 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
pQueryMsg
->
numOfOutput
=
htons
(
pQueryMsg
->
numOfOutput
);
pQueryMsg
->
numOfOutput
=
htons
(
pQueryMsg
->
numOfOutput
);
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryMsg
->
numOfGroupCols
);
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryMsg
->
numOfGroupCols
);
pQueryMsg
->
tagCondLen
=
htonl
(
pQueryMsg
->
tagCondLen
);
pQueryMsg
->
tagCondLen
=
htonl
(
pQueryMsg
->
tagCondLen
);
pQueryMsg
->
tsBuf
.
tsOffset
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOffset
);
pQueryMsg
->
tsBuf
.
tsOffset
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOffset
);
pQueryMsg
->
tsBuf
.
tsLen
=
htonl
(
pQueryMsg
->
tsBuf
.
tsLen
);
pQueryMsg
->
tsBuf
.
tsLen
=
htonl
(
pQueryMsg
->
tsBuf
.
tsLen
);
pQueryMsg
->
tsBuf
.
tsNumOfBlocks
=
htonl
(
pQueryMsg
->
tsBuf
.
tsNumOfBlocks
);
pQueryMsg
->
tsBuf
.
tsNumOfBlocks
=
htonl
(
pQueryMsg
->
tsBuf
.
tsNumOfBlocks
);
pQueryMsg
->
tsBuf
.
tsOrder
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOrder
);
pQueryMsg
->
tsBuf
.
tsOrder
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOrder
);
pQueryMsg
->
numOfTags
=
htonl
(
pQueryMsg
->
numOfTags
);
pQueryMsg
->
numOfTags
=
htonl
(
pQueryMsg
->
numOfTags
);
pQueryMsg
->
tbnameCondLen
=
htonl
(
pQueryMsg
->
tbnameCondLen
);
pQueryMsg
->
tbnameCondLen
=
htonl
(
pQueryMsg
->
tbnameCondLen
);
pQueryMsg
->
secondStageOutput
=
htonl
(
pQueryMsg
->
secondStageOutput
);
pQueryMsg
->
secondStageOutput
=
htonl
(
pQueryMsg
->
secondStageOutput
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
f3dcb6ed
...
@@ -2460,7 +2460,7 @@ int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist
...
@@ -2460,7 +2460,7 @@ int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist
// current file are not overlapped with query time window, ignore remain files
// current file are not overlapped with query time window, ignore remain files
if
((
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
&&
win
.
skey
>
pQueryHandle
->
window
.
ekey
)
||
if
((
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
&&
win
.
skey
>
pQueryHandle
->
window
.
ekey
)
||
(
!
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
&&
win
.
ekey
<
pQueryHandle
->
window
.
ekey
))
{
(
!
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
&&
win
.
ekey
<
pQueryHandle
->
window
.
ekey
))
{
tsdbUnLockFS
(
REPO_FS
(
pQueryHandle
->
pTsdb
));
tsdbUnLockFS
(
REPO_FS
(
pQueryHandle
->
pTsdb
));
tsdbDebug
(
"%p remain files are not qualified for qrange:%"
PRId64
"-%"
PRId64
", ignore, 0x%"
PRIx64
,
pQueryHandle
,
tsdbDebug
(
"%p remain files are not qualified for qrange:%"
PRId64
"-%"
PRId64
", ignore, 0x%"
PRIx64
,
pQueryHandle
,
pQueryHandle
->
window
.
skey
,
pQueryHandle
->
window
.
ekey
,
pQueryHandle
->
qId
);
pQueryHandle
->
window
.
skey
,
pQueryHandle
->
window
.
ekey
,
pQueryHandle
->
qId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录