Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e1ed9317
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看板
提交
e1ed9317
编写于
7月 07, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: insert from query
上级
d625cc2e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
27 deletion
+24
-27
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/libs/executor/inc/dataSinkInt.h
source/libs/executor/inc/dataSinkInt.h
+2
-1
source/libs/executor/src/dataDeleter.c
source/libs/executor/src/dataDeleter.c
+2
-2
source/libs/executor/src/dataDispatcher.c
source/libs/executor/src/dataDispatcher.c
+2
-2
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+8
-19
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+9
-2
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
e1ed9317
...
...
@@ -657,7 +657,7 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
}
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
||
TDMT_VND_DELETE
==
pRequest
->
type
||
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
)
{
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
||
TDMT_SCH_MERGE_QUERY
==
pRequest
->
type
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
res
.
numOfRows
;
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
...
...
source/libs/executor/inc/dataSinkInt.h
浏览文件 @
e1ed9317
...
...
@@ -34,7 +34,7 @@ typedef struct SDataSinkManager {
typedef
int32_t
(
*
FPutDataBlock
)(
struct
SDataSinkHandle
*
pHandle
,
const
SInputData
*
pInput
,
bool
*
pContinue
);
typedef
void
(
*
FEndPut
)(
struct
SDataSinkHandle
*
pHandle
,
uint64_t
useconds
);
typedef
void
(
*
FGetDataLength
)(
struct
SDataSinkHandle
*
pHandle
,
int
32
_t
*
pLen
,
bool
*
pQueryEnd
);
typedef
void
(
*
FGetDataLength
)(
struct
SDataSinkHandle
*
pHandle
,
int
64
_t
*
pLen
,
bool
*
pQueryEnd
);
typedef
int32_t
(
*
FGetDataBlock
)(
struct
SDataSinkHandle
*
pHandle
,
SOutputData
*
pOutput
);
typedef
int32_t
(
*
FDestroyDataSinker
)(
struct
SDataSinkHandle
*
pHandle
);
typedef
int32_t
(
*
FGetCacheSize
)(
struct
SDataSinkHandle
*
pHandle
,
uint64_t
*
size
);
...
...
@@ -50,6 +50,7 @@ typedef struct SDataSinkHandle {
int32_t
createDataDispatcher
(
SDataSinkManager
*
pManager
,
const
SDataSinkNode
*
pDataSink
,
DataSinkHandle
*
pHandle
);
int32_t
createDataDeleter
(
SDataSinkManager
*
pManager
,
const
SDataSinkNode
*
pDataSink
,
DataSinkHandle
*
pHandle
,
void
*
pParam
);
int32_t
createDataInserter
(
SDataSinkManager
*
pManager
,
const
SDataSinkNode
*
pDataSink
,
DataSinkHandle
*
pHandle
,
void
*
pParam
);
#ifdef __cplusplus
}
...
...
source/libs/executor/src/dataDeleter.c
浏览文件 @
e1ed9317
...
...
@@ -154,7 +154,7 @@ static void endPut(struct SDataSinkHandle* pHandle, uint64_t useconds) {
taosThreadMutexUnlock
(
&
pDeleter
->
mutex
);
}
static
void
getDataLength
(
SDataSinkHandle
*
pHandle
,
int
32
_t
*
pLen
,
bool
*
pQueryEnd
)
{
static
void
getDataLength
(
SDataSinkHandle
*
pHandle
,
int
64
_t
*
pLen
,
bool
*
pQueryEnd
)
{
SDataDeleterHandle
*
pDeleter
=
(
SDataDeleterHandle
*
)
pHandle
;
if
(
taosQueueEmpty
(
pDeleter
->
pDataBlocks
))
{
*
pQueryEnd
=
pDeleter
->
queryEnd
;
...
...
@@ -168,7 +168,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int32_t* pLen, bool* pQueryE
taosFreeQitem
(
pBuf
);
*
pLen
=
((
SDataCacheEntry
*
)(
pDeleter
->
nextOutput
.
pData
))
->
dataLen
;
*
pQueryEnd
=
pDeleter
->
queryEnd
;
qDebug
(
"got data len %
d
, row num %d in sink"
,
*
pLen
,
((
SDataCacheEntry
*
)(
pDeleter
->
nextOutput
.
pData
))
->
numOfRows
);
qDebug
(
"got data len %
"
PRId64
"
, row num %d in sink"
,
*
pLen
,
((
SDataCacheEntry
*
)(
pDeleter
->
nextOutput
.
pData
))
->
numOfRows
);
}
static
int32_t
getDataBlock
(
SDataSinkHandle
*
pHandle
,
SOutputData
*
pOutput
)
{
...
...
source/libs/executor/src/dataDispatcher.c
浏览文件 @
e1ed9317
...
...
@@ -156,7 +156,7 @@ static void endPut(struct SDataSinkHandle* pHandle, uint64_t useconds) {
taosThreadMutexUnlock
(
&
pDispatcher
->
mutex
);
}
static
void
getDataLength
(
SDataSinkHandle
*
pHandle
,
int
32
_t
*
pLen
,
bool
*
pQueryEnd
)
{
static
void
getDataLength
(
SDataSinkHandle
*
pHandle
,
int
64
_t
*
pLen
,
bool
*
pQueryEnd
)
{
SDataDispatchHandle
*
pDispatcher
=
(
SDataDispatchHandle
*
)
pHandle
;
if
(
taosQueueEmpty
(
pDispatcher
->
pDataBlocks
))
{
*
pQueryEnd
=
pDispatcher
->
queryEnd
;
...
...
@@ -170,7 +170,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int32_t* pLen, bool* pQueryE
taosFreeQitem
(
pBuf
);
*
pLen
=
((
SDataCacheEntry
*
)(
pDispatcher
->
nextOutput
.
pData
))
->
dataLen
;
*
pQueryEnd
=
pDispatcher
->
queryEnd
;
qDebug
(
"got data len %
d
, row num %d in sink"
,
*
pLen
,
((
SDataCacheEntry
*
)(
pDispatcher
->
nextOutput
.
pData
))
->
numOfRows
);
qDebug
(
"got data len %
"
PRId64
"
, row num %d in sink"
,
*
pLen
,
((
SDataCacheEntry
*
)(
pDispatcher
->
nextOutput
.
pData
))
->
numOfRows
);
}
static
int32_t
getDataBlock
(
SDataSinkHandle
*
pHandle
,
SOutputData
*
pOutput
)
{
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
e1ed9317
...
...
@@ -50,24 +50,6 @@ typedef struct SSubmitRspParam {
SDataInserterHandle
*
pInserter
;
}
SSubmitRspParam
;
static
int32_t
updateStatus
(
SDataInserterHandle
*
pInserter
)
{
taosThreadMutexLock
(
&
pInserter
->
mutex
);
int32_t
blockNums
=
taosQueueItemSize
(
pInserter
->
pDataBlocks
);
int32_t
status
=
(
0
==
blockNums
?
DS_BUF_EMPTY
:
(
blockNums
<
pInserter
->
pManager
->
cfg
.
maxDataBlockNumPerQuery
?
DS_BUF_LOW
:
DS_BUF_FULL
));
pInserter
->
status
=
status
;
taosThreadMutexUnlock
(
&
pInserter
->
mutex
);
return
status
;
}
static
int32_t
getStatus
(
SDataInserterHandle
*
pInserter
)
{
taosThreadMutexLock
(
&
pInserter
->
mutex
);
int32_t
status
=
pInserter
->
status
;
taosThreadMutexUnlock
(
&
pInserter
->
mutex
);
return
status
;
}
int32_t
inserterCallback
(
void
*
param
,
SDataBuf
*
pMsg
,
int32_t
code
)
{
SSubmitRspParam
*
pParam
=
(
SSubmitRspParam
*
)
param
;
SDataInserterHandle
*
pInserter
=
pParam
->
pInserter
;
...
...
@@ -236,6 +218,13 @@ static void endPut(struct SDataSinkHandle* pHandle, uint64_t useconds) {
taosThreadMutexUnlock
(
&
pInserter
->
mutex
);
}
static
void
getDataLength
(
SDataSinkHandle
*
pHandle
,
int64_t
*
pLen
,
bool
*
pQueryEnd
)
{
SDataInserterHandle
*
pDispatcher
=
(
SDataInserterHandle
*
)
pHandle
;
*
pLen
=
pDispatcher
->
submitRes
.
affectedRows
;
qDebug
(
"got total affectedRows %"
PRId64
,
*
pLen
);
}
static
int32_t
destroyDataSinker
(
SDataSinkHandle
*
pHandle
)
{
SDataInserterHandle
*
pInserter
=
(
SDataInserterHandle
*
)
pHandle
;
atomic_sub_fetch_64
(
&
gDataSinkStat
.
cachedSize
,
pInserter
->
cachedSize
);
...
...
@@ -262,7 +251,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
SDataDeleterNode
*
pInserterNode
=
(
SQueryInserterNode
*
)
pDataSink
;
inserter
->
sink
.
fPut
=
putDataBlock
;
inserter
->
sink
.
fEndPut
=
endPut
;
inserter
->
sink
.
fGetLen
=
NULL
;
inserter
->
sink
.
fGetLen
=
getDataLength
;
inserter
->
sink
.
fGetData
=
NULL
;
inserter
->
sink
.
fDestroy
=
destroyDataSinker
;
inserter
->
sink
.
fGetCacheSize
=
getCacheSize
;
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
e1ed9317
...
...
@@ -236,16 +236,23 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
}
case
TDMT_SCH_QUERY_RSP
:
case
TDMT_SCH_MERGE_QUERY_RSP
:
{
SQueryTableRsp
*
rsp
=
(
SQueryTableRsp
*
)
msg
;
SCH_ERR_JRET
(
rspCode
);
if
(
NULL
==
msg
)
{
SCH_ERR_JRET
(
TSDB_CODE_QRY_INVALID_INPUT
);
}
SQueryTableRsp
*
rsp
=
(
SQueryTableRsp
*
)
msg
;
rsp
->
code
=
ntohl
(
rsp
->
code
);
rsp
->
sversion
=
ntohl
(
rsp
->
sversion
);
rsp
->
tversion
=
ntohl
(
rsp
->
tversion
);
rsp
->
affectedRows
=
be64toh
(
rsp
->
affectedRows
);
SCH_ERR_JRET
(
rsp
->
code
);
SCH_ERR_JRET
(
schSaveJobQueryRes
(
pJob
,
rsp
));
atomic_add_fetch_32
(
&
pJob
->
resNumOfRows
,
rsp
->
affectedRows
);
taosMemoryFreeClear
(
msg
);
SCH_ERR_RET
(
schProcessOnTaskSuccess
(
pJob
,
pTask
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录